From: Andy Zhou Date: Wed, 29 Jan 2014 16:36:05 +0000 (-0800) Subject: datapath: Do not free in use mask list, fixes a kernel crash bug X-Git-Tag: v2.0.2~38 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=c97c48505a2a37a143f6bd8bac4f550022fa3d2a datapath: Do not free in use mask list, fixes a kernel crash bug Last commit 738a2445c0 introduced a bug where the mask list of a flow table was freed even when the table's flows and mask list is reused by another table. Bug #32932 Reported-by: Len Gao Signed-off-by: Andy Zhou Acked-by: Jesse Gross --- diff --git a/datapath/flow.c b/datapath/flow.c index b9ad60830..2e46866e5 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -502,8 +502,10 @@ static struct flow_table *__flow_tbl_alloc(int new_size) static void __flow_tbl_destroy(struct flow_table *table) { - BUG_ON(!list_empty(table->mask_list)); - kfree(table->mask_list); + if (!table->keep_flows) { + BUG_ON(!list_empty(table->mask_list)); + kfree(table->mask_list); + } free_buckets(table->buckets); kfree(table);