From: Julia Lawall Date: Thu, 6 Aug 2009 20:05:18 +0000 (+0200) Subject: Bluetooth: Add missing kmalloc NULL tests to Marvell driver X-Git-Tag: v2.6.32-rc1~703^2~221^2~24 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5959809ded86e267c1a95fb44738a224c30d3434;p=pandora-kernel.git Bluetooth: Add missing kmalloc NULL tests to Marvell driver Check that the result of kmalloc is not NULL before dereferencing it. The patch also replaces kmalloc + memset by kzalloc. 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: Marcel Holtmann --- Reading git-diff-tree failed