Author: Julia Lawall <julia@diku.dk> Memset should be given the size of the structure, not the size of the pointer. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ type T; T *x; expression E; @@ memset(x, E, sizeof( + * x)) // Signed-off-by: Julia Lawall Acked-by: Laurent Pinchart Signed-off-by: Douglas Schilling …
Catégorie : Linux
Dec 10 2009
RDMA/nes: Pass correct size to ioremap_nocache()
Author: Julia Lawall <julia@diku.dk> The size argument to ioremap_nocache should be the size of desired information, not the pointer to it. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression *x; @@ x = // Signed-off-by: Julia Lawall Acked-by: Chien Tung Signed-off-by: Roland Dreier — drivers/infiniband/hw/nes/nes.c | 3 ++- 1 …
Dec 09 2009
perf tools: Correct size given to memset
Author: Julia Lawall <julia@diku.dk> Memset should be given the size of the structure, not the size of the pointer. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ type T; T *x; expression E; @@ memset(x, E, sizeof( + * x)) // Signed-off-by: Julia Lawall Cc: Peter Zijlstra Cc: Paul Mackerras …
Dec 09 2009
net/mac80211: Correct size given to memset
Author: Julia Lawall <julia@diku.dk> Memset should be given the size of the structure, not the size of the pointer. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ type T; T *x; expression E; @@ memset(x, E, sizeof( + * x)) // Signed-off-by: Julia Lawall Signed-off-by: John W. Linville — net/mac80211/mesh.c …
Dec 09 2009
Staging: wlan-ng: fix Correct size given to memset
Author: Julia Lawall <julia@diku.dk> Memset should be given the size of the structure, not the size of the pointer. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ type T; T *x; expression E; @@ memset(x, E, sizeof( + * x)) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/wlan-ng/prism2fw.c | …
Dec 09 2009
USB: gadget: Use ERR_PTR/IS_ERR
Author: Julia Lawall <julia@diku.dk> Use ERR_PTR and IS_ERR rather than mixing integers and pointers. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *E; @@ * E < 0 // Signed-off-by: Julia Lawall Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/f_audio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 …
Dec 07 2009
sh: Replace an explicit computation by the use of the container_of macro
Author: Nicolas Palix <npalix@diku.dk> The macro container_of from kernel.h performs the same pointer arithmetic operation. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ type T; expression mptr; expression member; @@ – (void *)((char *)mptr – offsetof(T, member)) + container_of(mptr, T, member) // Signed-off-by: Nicolas Palix Signed-off-by: Paul Mundt — arch/sh/kernel/cpu/irq/ipr.c …
Dec 06 2009
security/selinux/ss: correct size computation
Author: Julia Lawall <julia@diku.dk> The size argument to kcalloc should be the size of desired structure, not the pointer to it. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression *x; @@ x = // Signed-off-by: Julia Lawall Acked-by: Eric Paris Signed-off-by: James Morris — security/selinux/ss/services.c | 4 ++– 1 …
Dec 06 2009
perf tools: Correct size computation in tracepoint_id_to_path()
Author: Julia Lawall <julia@diku.dk> The size argument to zalloc should be the size of desired structure, not the pointer to it. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression *x; @@ x = // Signed-off-by: Julia Lawall Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho …
Nov 30 2009
arch/alpha/kernel: Add kmalloc NULL tests
Author: Julia Lawall <julia@diku.dk> Check that the result of kmalloc is not NULL before passing it to other functions. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(…); … when != x == NULL when != x != NULL when …