From: Julia Lawall Date: Mon, 18 Oct 2010 04:11:14 +0000 (+0000) Subject: drivers/net/ax88796.c: Return error code in failure X-Git-Tag: v2.6.37-rc1~147^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13eea19213c1f4b711124ddc08c4bb9344442b64;p=pandora-kernel.git drivers/net/ax88796.c: Return error code in failure In this code, 0 is returned on 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/) // @a@ identifier alloc; identifier ret; constant C; expression x; @@ x = alloc(...); if (x == NULL) { <+... \(ret = -C; \| return -C; \) ...+> } @@ identifier f, a.alloc; expression ret; expression x,e1,e2,e3; @@ ret = 0 ... when != ret = e1 *x = alloc(...) ... when != ret = e2 if (x == NULL) { ... when != ret = e3 return ret; } // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- Reading git-diff-tree failed