From: Julia Lawall Date: Fri, 31 Jul 2009 06:32:03 +0000 (+0200) Subject: ALSA: sound/aoa: Add kmalloc NULL tests X-Git-Tag: v2.6.31-rc5~5^2~1^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f065fabc864f4c98857bf67caa2365e9f8545751;p=pandora-kernel.git ALSA: sound/aoa: Add kmalloc NULL tests Check that the result of kzalloc is not NULL before a dereference. 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 Signed-off-by: Takashi Iwai --- Reading git-diff-tree failed