Author: Julia Lawall <julia@diku.dk> 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/) …
Oct 15 2010
SERIAL: ioc3_serial: Return -ENOMEM on memory allocation failure
Author: Julia Lawall <julia@diku.dk> 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 …
Oct 15 2010
drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure
Author: Julia Lawall <julia@diku.dk> 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 …
Oct 02 2010
drivers/gpu/drm/i915/i915_gem.c: Add missing error handling code
Author: Julia Lawall <julia@diku.dk> Extend the error handling code with operations found in other nearby error handling code A simplified version of the sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ @r@ statement S1,S2,S3; constant C1,C2,C3; @@ *if (…) {… S1 return -C1;} … *if (…) {… when != S1 …
Oct 02 2010
[media] drivers/media/dvb/ttpci/av7110_av.c: Add missing error handling code
Author: Julia Lawall <julia@diku.dk> Extend the error handling code with operations found in other nearby error handling code. A simplified version of the sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ @r@ statement S1,S2,S3; constant C1,C2,C3; @@ *if (…) {… S1 return -C1;} … *if (…) {… when != S1 …
Oct 02 2010
drivers/atm/idt77252.c: Remove unnecessary error check
Author: Julia Lawall <julia@diku.dk> This code does not call deinit_card(card); in an error case, as done in other error-handling code in the same function. But actually, the called function init_sram can only return 0, so there is no need for the error check at all. init_sram is also given a void return type, and its …
Sep 29 2010
spi/amba-pl022: Fix error case return statement.
Author: Julia Lawall <julia@diku.dk> The return -EINVAL appears to only make sense if the if branch that it is aligned with is taken, and the indentation indicates that this is the authors intent, so move it into that branch. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r disable braces4@ position …
Sep 29 2010
spi/orion: Drop unnecessary null test
Author: Julia Lawall <julia@diku.dk> list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x,E; @@ I(x,…) { } // Signed-off-by: Julia Lawall Signed-off-by: Grant Likely — …
Sep 28 2010
staging: wlags49_h2: use free_netdev(netdev) instead of kfree()
Author: Vasiliy Kulikov <segooon@gmail.com> Freeing netdev without free_netdev() leads to net, tx leaks. I might lead to dereferencing freed pointer. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) @@ struct net_device* dev; @@ -kfree(dev) +free_netdev(dev) Signed-off-by: Vasiliy Kulikov Signed-off-by: Greg Kroah-Hartman — drivers/staging/wlags49_h2/wl_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 …
Sep 28 2010
staging: slicoss: use free_netdev(netdev) instead of kfree()
Author: Vasiliy Kulikov <segooon@gmail.com> Freeing netdev without free_netdev() leads to net, tx leaks. I might lead to dereferencing freed pointer. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) @@ struct net_device* dev; @@ -kfree(dev) +free_netdev(dev) Signed-off-by: Vasiliy Kulikov Acked-by: Denis Kirjanov Signed-off-by: Greg Kroah-Hartman — drivers/staging/slicoss/slicoss.c | 2 +- 1 file changed, …