staging: otus: 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/otus/usbdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 …

Lire la suite

s390: 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: David S. Miller — drivers/s390/net/ctcm_main.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   …

Lire la suite

sgiseeq: use free_netdev(netdev) instead of kfree()

Author: Kulikov Vasiliy <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: David S. Miller — drivers/net/sgiseeq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   …

Lire la suite

rionet: use free_netdev(netdev) instead of kfree()

Author: Kulikov Vasiliy <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: David S. Miller — drivers/net/rionet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   …

Lire la suite

ibm_newemac: use free_netdev(netdev) instead of kfree()

Author: Kulikov Vasiliy <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: David S. Miller — drivers/net/ibm_newemac/core.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   …

Lire la suite

drivers/mmc/host/imxmmc.c: adjust confusing if indentation

Author: Julia Lawall <julia@diku.dk> Move the second if (reg & …) test into the branch indicated by its indentation. The test was previously always executed after the if containing that branch, but it was always false unless the if branch was taken. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r …

Lire la suite

drivers/net/wireless/iwlwifi/iwl-agn.c: Fix return value from an unsigned function

Author: Julia Lawall <julia@diku.dk> The function has an unsigned return type, but returns a negative constant to indicate an error condition. Another error condition in the same function is indicated by returning 0, and indeed the only call to the function checks for 0 to detect errors, so the return of a negative value it …

Lire la suite

Staging: comedi: Fix unsigned return type

Author: Julia Lawall <julia@diku.dk> In each case, the function has an unsigned return type, but returns a negative constant to indicate an error condition. For move_block_from_dma, there is only one call and the return value is dropped, so it need not be unsigned. For labpc_eeprom_write, there is only one call and the result is stored …

Lire la suite

[CPUFREQ] arch/x86/kernel/cpu/cpufreq: Fix unsigned return type

Author: Julia Lawall <julia@diku.dk> In each case, the function has an unsigned return type, but returns a negative constant to indicate an error condition. Each function is only called once. For nforce2_detect_chipset, the result is only compared to 0, and for longrun_determine_freqs, the result is stored in a variable of type (signed) int. Thus, for …

Lire la suite

drivers/atm/firestream.c: Fix unsigned return type

Author: Julia Lawall <julia@diku.dk> The function has an unsigned return type, but returns a negative constant to indicate an error condition. The result of calling the function is always stored in a variable of type (signed) int, and thus unsigned can be dropped from the return type. A sematic match that finds this problem is …

Lire la suite