linux-stable/net/rfkill
Julia Lawall bd2281b85d 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/)

// <smpl>
@@
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);// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-16 14:10:42 -04:00
..
core.c net/rfkill/core.c: Avoid leaving freed data in a list 2011-05-16 14:10:42 -04:00
input.c net: return operator cleanup 2010-09-23 14:33:39 -07:00
Kconfig rfkill: Regulator consumer driver for rfkill 2011-04-19 15:38:02 -04:00
Makefile rfkill: Regulator consumer driver for rfkill 2011-04-19 15:38:02 -04:00
rfkill-regulator.c rfkill: Regulator consumer driver for rfkill 2011-04-19 15:38:02 -04:00
rfkill.h rfkill: rewrite 2009-06-03 14:06:13 -04:00