From: Arnaldo Carvalho de Melo Date: Tue, 21 Mar 2006 01:20:46 +0000 (-0800) Subject: [DCCP] ackvec: Delete all the ack vector records in dccp_ackvec_free X-Git-Tag: v2.6.17-rc1~1175^2~192 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5e9b2c737ecaedae66e3dffdd0d92d2a189ec5c;p=linux-2.6 [DCCP] ackvec: Delete all the ack vector records in dccp_ackvec_free Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index b4ff14f3d4..5c76e81658 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c @@ -159,7 +159,17 @@ void dccp_ackvec_free(struct dccp_ackvec *av) { if (unlikely(av == NULL)) return; - WARN_ON(!list_empty(&av->dccpav_records)); + + if (!list_empty(&av->dccpav_records)) { + struct dccp_ackvec_record *avr, *next; + + list_for_each_entry_safe(avr, next, &av->dccpav_records, + dccpavr_node) { + list_del_init(&avr->dccpavr_node); + dccp_ackvec_record_delete(avr); + } + } + kmem_cache_free(dccp_ackvec_slab, av); }