scripts/coccinelle/free: add NULL test before freeing functions
authorFabian Frederick <fabf@skynet.be>
Fri, 8 Aug 2014 21:23:29 +0000 (14:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:26 +0000 (15:57 -0700)
commit791dfeb49519f18a6efea4619f5678457f1532ff
treed3f6d2e6e526eb6f6d382f5c9980abd8b002ea2c
parent56106da7932074804f9ef70191f126ea15dc3fc4
scripts/coccinelle/free: add NULL test before freeing functions

Warns or generates patch for NULL check before the following functions:

kfree
usb_free_urb
debugfs_remove
debugfs_remove_recursive

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>
Cc: Joe Perches <joe@perches.com>
Cc: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/coccinelle/free/ifnullfree.cocci [new file with mode: 0644]