Author: Julia Lawall <julia@diku.dk> This goto is after the call to clk_get, so it should go to the label that includes a call to clk_put. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression e1,e2; statement S; @@ e1 = clk_get@p1(…); … when != e1 …
Jun 01 2011
drivers/net/davinci_emac.c: add missing clk_put
Author: Julia Lawall <julia@diku.dk> Go to existing error handling code at the end of the function that calls clk_put. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression e1,e2; statement S; @@ e1 = clk_get@p1(…); … when != e1 = e2 when != clk_put(e1) when …
May 27 2011
drivers/char/ppdev.c: put gotten port value
Author: Julia Lawall <julia@diku.dk> parport_find_number() calls parport_get_port() on its result, so there should be a corresponding call to parport_put_port() before dropping the reference. Similar code is found in the function register_device() in the same file. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @exists@ local idexpression struct parport * x; expression …
May 27 2011
drivers/rtc/rtc-mrst.c: use release_mem_region after request_mem_region
Author: Julia Lawall <julia@diku.dk> The memory allocated using request_mem_region should be released using release_mem_region, not release_region. The semantic patch that fixes part of this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1,E2,E3; @@ request_mem_region(E1,E2,E3) … ?- release_region(E1,E2) + release_mem_region(E1,E2) // [akpm@linux-foundation.org: use resource_size()] Signed-off-by: Julia Lawall Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus …
May 20 2011
[media] imon: Correct call to input_free_device
Author: Julia Lawall <julia@diku.dk> ictx->touch is intialied in imon_init_intf1, to the result of calling the function that contains this code. Thus, in this code, input_free_device should be called on touch itself. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression struct input_dev * x; expression ra,rr; …
May 18 2011
drivers/staging/cptm1217/clearpad_tm1217.c: Correct call to input_free_device
Author: Julia Lawall <julia@diku.dk> This code is in a loop that currently is only executed once. Because of this property, the first block of code is currently actually correct. Nevertheless, the comments associated with the code suggest that the loop is planned to take more than one iteration in the future, and thus this patch …
May 16 2011
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 …
May 14 2011
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 (…) { … …
May 13 2011
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); // …
May 13 2011
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 …