From: Julia Lawall Date: Fri, 7 Aug 2009 07:00:34 +0000 (+0200) Subject: powerpc/fsl_rio: Add kmalloc NULL tests X-Git-Tag: v2.6.32-rc1~675^2~76 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c75933c00049bee59562a18843a4f133ec2bfe4;p=pandora-kernel.git powerpc/fsl_rio: Add kmalloc NULL tests Check that the result of kmalloc/kzalloc is not NULL before dereferencing it. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ 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 Signed-off-by: Kumar Gala Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed