From: Julia Lawall Date: Fri, 15 Oct 2010 13:00:06 +0000 (+0200) Subject: drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure X-Git-Tag: v2.6.37-rc1~147^2~78^2^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d91f22b75347d9503b17a42b6c74d3f7750acd6;p=pandora-kernel.git drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure In this code, 0 is returned on memory allocation failure, even though other failures return -ENOMEM or other similar values. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression ret; expression x,e1,e2,e3; @@ ret = 0 ... when != ret = e1 *x = \(kmalloc\|kcalloc\|kzalloc\)(...) ... when != ret = e2 if (x == NULL) { ... when != ret = e3 return ret; } // Signed-off-by: Julia Lawall Cc: Acked-by: Christian Lamparter Signed-off-by: John W. Linville --- Reading git-diff-tree failed