Catégorie : Linux

V4L/DVB (13610): uvc: 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 Acked-by: Laurent Pinchart Signed-off-by: Douglas Schilling …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 | …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite