From: Julia Lawall Date: Thu, 30 Jul 2009 04:38:19 +0000 (+0000) Subject: net/netlabel: Add kmalloc NULL tests X-Git-Tag: v2.6.31-rc6~68^2~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca7daea612b480ecf0fc5bd1630b88447fe73fc5;p=pandora-kernel.git net/netlabel: Add kmalloc NULL tests The test on map4 should be a test on map6. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ... when != x == NULL when != x != NULL when != (x || ...) ( kfree(x) | f(...,C,...,x,...) | *f(...,x,...) | *x->f ) // Signed-off-by: Julia Lawall Acked-by: Paul Moore Signed-off-by: David S. Miller --- Reading git-diff-tree failed