From: Julia Lawall Date: Fri, 13 May 2011 13:52:10 +0000 (+0200) Subject: net/rfkill/core.c: Avoid leaving freed data in a list X-Git-Tag: v3.0-rc1~377^2~54^2^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd2281b85d929af0bd192f05135f70dd05f4fd85;p=pandora-kernel.git net/rfkill/core.c: Avoid leaving freed data in a list The list_for_each_entry loop can fail, in which case the list element is not removed from the list rfkill_fds. Since this list is not accessed by the loop, the addition of &data->list into the list is just moved after the loop. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E,E1,E2; identifier l; @@ *list_add(&E->l,E1); ... when != E1 when != list_del(&E->l) when != list_del_init(&E->l) when != E = E2 *kfree(E);// Signed-off-by: Julia Lawall Signed-off-by: John W. Linville --- Reading git-diff-tree failed