From: Julia Lawall Date: Fri, 15 Oct 2010 13:00:10 +0000 (+0200) Subject: staging: tidspbridge: Clean up error-handling code X-Git-Tag: v2.6.37-rc1~60^2~3^2~79 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc58cbb88569e3ecb9786b3da891e7d019d2cfff;p=pandora-kernel.git staging: tidspbridge: Clean up error-handling code In the first hunk, 0 is returned on memory allocation failure, even though other failures return -ENOMEM or other similar values. In the second hunk, there was error handling code that returned without freeing psz_path_name. A simplified version of the semantic match that finds the first 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 Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed