Author: Julia Lawall <julia@diku.dk> Use kstrtoul, etc instead of the now deprecated strict_strtoul, etc. A semantic patch rule for the kstrtoul case is as follows: (http://coccinelle.lip6.fr/) // @@ expression a,b; {int,long} *c; @@ -strict_strtoul +kstrtoul (a,b,c) // Signed-off-by: Julia Lawall Signed-off-by: John W. Linville — net/rfkill/core.c | 4 ++– 1 file changed, 2 insertions(+), 2 …
Nov 06 2011
net/mac80211/debugfs.c: use kstrtoul, etc
Author: Julia Lawall <julia@diku.dk> Use kstrtoul, etc instead of the now deprecated strict_strtoul, etc. A semantic patch rule for the kstrtoul case is as follows: (http://coccinelle.lip6.fr/) // @@ expression a,b; {int,long} *c; @@ -strict_strtoul +kstrtoul (a,b,c) // Signed-off-by: Julia Lawall Signed-off-by: John W. Linville — net/mac80211/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 …
Nov 06 2011
coccicheck: add M= option to control which dir is processed
Author: Greg Dietsche <Gregory.Dietsche@cuw.edu> Examples: make coccicheck M=drivers/net/wireless/ make coccicheck SUBDIRS=drivers/net/wireless/ Version 2: fix patch file names when using M= tell coccinelle where the include files are Version 3: Add second include option to support out of tree development Fix error message Signed-off-by: Greg Dietsche Acked-by: Julia Lawall Signed-off-by: Michal Marek — scripts/coccicheck | 19 …
Nov 01 2011
HID: drivers/hid/hid-roccat.c: eliminate a null pointer dereference
Author: Julia Lawall <julia@diku.dk> It is not possible to take the lock in device if device is NULL. The mutex_lock is thus moved after the NULL test. New error handling labels are added at the end to differentiate between the cases where different sets of locks should be unlocks, and between whether or not reader …
Oct 29 2011
drivers/staging/rtl8712/rtl871x_mlme.c: eliminate a null pointer dereference
Author: Julia Lawall <julia@diku.dk> If ibss_wlan is NULL, it is not correct to memcpy into its field. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ expression E, E1; identifier f; statement S1,S2,S3; @@ if (E == NULL) { … when != if (E == NULL || …) S1 else S2 …
Oct 18 2011
ASoC: keep pointer to resource so it can be freed
Author: Julia Lawall <julia@diku.dk> Add a new variable for storing resources accessed subsequent to the one accessed using request_mem_region, so the one accessed using request_mem_region can be released if needed. The resource variable names are also changed to be more descriptive. This code is also missing some calls to iounmap. The semantic match that finds …
Sep 16 2011
[SCSI] mpt2sas: take size of pointed value, not pointer
Author: Julia Lawall <julia@diku.dk> Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed data. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *e; type T; identifier f; @@ f(…,(T)e,…, -sizeof(e) +sizeof(*e) ,…) // Signed-off-by: Julia Lawall Signed-off-by: James Bottomley — drivers/scsi/mpt2sas/mpt2sas_transport.c | 2 …
Sep 16 2011
drivers/staging/mei/interface.c: take size of pointed value, not pointer
Author: Julia Lawall <julia@diku.dk> Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed data. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *e; type T; identifier f; @@ f(…,(T)e,…, -sizeof(e) +sizeof(*e) ,…) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/mei/interface.c | 4 …
Aug 26 2011
drivers/char/msm_smd_pkt.c: don’t use IS_ERR()
Author: Thomas Meyer <thomas@m3y3r.de> The various basic memory allocation function return NULL, not an ERR_PTR. The semantic patch that makes this change is available in scripts/coccinelle/null/eno.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer Cc: Niranjana Vishwanathapura Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds — drivers/char/msm_smd_pkt.c | 5 ++— 1 file changed, …
Aug 24 2011
[S390] drivers/s390/block/dasd_ioctl.c: add missing kfree
Author: Julia Lawall <julia@diku.dk> Data is only used to temporarily hold information to be copied to the user level, so it should be freed before leaving the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @exists@ local idexpression x; statement S,S1; expression E; identifier fl; expression …