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

Continue reading

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 …

Continue reading

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 …

Continue reading

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 …

Continue reading

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

Continue reading

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 …

Continue reading

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 …

Continue reading

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 …

Continue reading

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 …

Continue reading

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 …

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.