Category: Linux

drivers/staging/ath6kl/os/linux/cfg80211.c: Add missing call to cfg80211_put_bss

Author: Julia Lawall <julia@diku.dk> A call to cfg80211_get_bss hould be accompanied by a call to cfg80211_put_bss in error-handling code. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression struct cfg80211_bss * x; expression ra,rr; position p1,p2; @@ x = cfg80211_get_bss@p1(…) … when != x = rr …

Continue reading

fs/btrfs: Add missing btrfs_free_path

Author: Julia Lawall <julia@diku.dk> Btrfs_alloc_path should be matched with btrfs_free_path in error-handling code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression struct btrfs_path * x; expression ra,rb; position p1,p2; @@ x = btrfs_alloc_path@p1(…) … when != btrfs_free_path(x,…) when != if (…) { … …

Continue reading

arch/arm/mach-omap1/dma.c: Invert calls to platform_device_put and platform_device_del

Author: Julia Lawall <julia@diku.dk> Platform_device_del should be called before platform_device_put, as platform_device_put can delete the structure. Additionally, improve the error handling code for the call to ioremap, so that it calls platform_device_put. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @@ expression e1,e2; @@ *platform_device_put(e1); … when != e1 = e2 *platform_device_del(e1); // …

Continue reading

drivers/staging/vt6656/main_usb.c: Delete unnecessary call to usb_kill_urb

Author: Julia Lawall <julia@diku.dk> Since in each case nothing has been done with the recently allocated urb, it is not necessary to kill it before freeing it. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression urb; statement S; position p1,p2; @@ urb = usb_alloc_urb@p1(…); … when != urb …

Continue reading

drivers/usb/serial/opticon.c: Release resources on kmalloc failure

Author: Julia Lawall <julia@diku.dk> Several resources have been allocated before this kmalloc failure, and thus they should be released in this error handling code, as done in nearby error handling code. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression urb; statement S; position p1,p2; @@ urb = usb_alloc_urb@p1(…); … …

Continue reading

net/rfkill/core.c: Avoid leaving freed data in a list

Author: Julia Lawall <julia@diku.dk> The list_for_each_entry loop can fail, in which case the list element is not removed from the list rfkill_fds. Since this list is not accessed by the loop, the addition of &data->list into the list is just moved after the loop. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) …

Continue reading

x86, mce, AMD: Fix leaving freed data in a list

Author: Julia Lawall <julia@diku.dk> b may be added to a list, but is not removed before being freed in the case of an error. This is done in the corresponding deallocation function, so the code here has been changed to follow that. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ …

Continue reading

rtlwifi: rtl8192cu: Fix memset/memcpy using sizeof(ptr) not sizeof(*ptr)

Author: Joe Perches <joe@perches.com> Found via coccinelle script @@ type T; T* ptr; expression E1; @@ * memset(E1, 0, sizeof(ptr)); Signed-off-by: Joe Perches Signed-off-by: John W. Linville — drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 79c98f6..3a92ba3 100644 — a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c @@ -372,7 +372,7 @@ …

Continue reading

staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr)

Author: Joe Perches <joe@perches.com> Found via coccinelle script @@ type T; T* ptr; expression E1; @@ * memset(E1, 0, sizeof(ptr)); Signed-off-by: Joe Perches Acked-by: Roland Vossen Signed-off-by: Greg Kroah-Hartman — drivers/staging/brcm80211/brcmfmac/wl_iw.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-)   diff –git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index a16b46c..4b810ed 100644 — a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c @@ -498,9 …

Continue reading

[SCSI] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr)

Author: Joe Perches <joe@perches.com> Not at all sure this is correct or appropriate to change, but this seems odd. Found via coccinelle script @@ type T; T* ptr; expression E1; @@ * memset(E1, 0, sizeof(ptr)); Signed-off-by: Joe Perches Acked-by: Stephen M. Cameron Signed-off-by: James Bottomley Signed-off-by: James Bottomley — drivers/scsi/hpsa.c | 2 +- 1 file …

Continue reading

BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.