Articles de cet auteur
Jan 08 2013
i2c: muxes: fix wrong use of sizeof(ptr)
Author: Laurent Navet <laurent.navet@gmail.com> sizeof when applied to a pointer typed expression gives the size of the pointer The semantic patch that makes this output is available in scripts/coccinelle/misc/noderef.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Laurent Navet Acked-by: Jean Delvare Signed-off-by: Wolfram Sang — drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- 1 file changed, …
Jan 07 2013
crypto: bfin_crc – reposition free_irq to avoid access to invalid data
Author: Julia Lawall <Julia.Lawall@lip6.fr> The data referenced by an interrupt handler should not be freed before the interrupt is ended. The handler is bfin_crypto_crc_handler. It may refer to crc->regs, which is released by the iounmap. Furthermore, the second argument to all calls to free_irq is incorrect. It should be the same as the last argument …
Jan 06 2013
88pm860x_battery: Eliminate possible references to released resources
Author: Julia Lawall <julia.lawall@lip6.fr> devm_kzalloc should not be followed by kfree, as this results in a double free. The problem was found using the following semantic match (http://coccinelle.lip6.fr/): // @@ expression x,e; @@ x = devm_kzalloc(…) … when != x = e ?-kfree(x,…); // Furthermore, in the remove function, the calls to free_irq are moved …
Jan 03 2013
MIPS: Loongson2: Use clk API instead of direct dereferences
Author: Julia Lawall <Julia.Lawall@lip6.fr> A struct clk value is intended to be an abstract pointer, so it should be manipulated using the various API functions. clk_put is additionally added on the failure paths. The semantic match that finds the first problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; identifier i; @@ *e = clk_get(…) …
Dec 22 2012
[SCSI] bnx2fc: Remove potential NULL dereference
Author: Julia Lawall <Julia.Lawall@lip6.fr> If the NULL test is necessary, the initialization involving a dereference of the tested value should be moved after the NULL test. The sematic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ type T; expression E; identifier i,fld; statement S; @@ – T i = E->fld; + T …
Dec 16 2012
arch/arm/mach-omap2/dpll3xxx.c: drop if around WARN_ON
Author: Julia Lawall <Julia.Lawall@lip6.fr> Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ – if (e) WARN_ON(1); + WARN_ON(e); // Signed-off-by: Julia Lawall Signed-off-by: Tony Lindgren — arch/arm/mach-omap2/dpll3xxx.c | 3 +– 1 file changed, …
Dec 14 2012
acer-wmi: fix obj is NULL but dereferenced
Author: Lee, Chun-Yi <joeyli.kernel@gmail.com> Fengguang Wu run coccinelle and warns about: drivers/platform/x86/acer-wmi.c:1200:17-21: ERROR: obj is NULL but dereferenced. drivers/platform/x86/acer-wmi.c:891:17-21: ERROR: obj is NULL but dereferenced. drivers/platform/x86/acer-wmi.c:1953:17-21: ERROR: obj is NULL but dereferenced. It causes by the code in patch 987dfbaa65b2c3568b85e29d2598da08a011ee09 doesn’t check obj variable should not be NULL. There have risk for dereference a NULL …
Dec 11 2012
[media] media: saa7146: don’t use mutex_lock_interruptible() in device_release()
Author: Cyril Roelandt <tipecaml@gmail.com> Use uninterruptible mutex_lock in the release() file op to make sure all resources are properly freed when a process is being terminated. Returning -ERESTARTSYS has no effect for a terminating process and this may cause driver resources not to be released. This was found using the following semantic patch (http://coccinelle.lip6.fr/): @r@ …
Dec 08 2012
drivers/base/core.c: Remove two unused variables and two useless calls to kfree
Author: Peter Senna Tschudin <peter.senna@gmail.com> old_class_name, and new_class_name are never used. This patch remove the declaration and calls to kfree. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r1 forall@ type T; identifier i; @@ * T *i = NULL; … when != i * kfree(i); // Signed-off-by: Peter Senna Tschudin …
Dec 07 2012
vfio: simplify kmalloc+copy_from_user to memdup_user
Author: Fengguang Wu <fengguang.wu@intel.com> Generated by: coccinelle/api/memdup_user.cocci Acked-by: Julia Lawall Reported-by: Fengguang Wu Signed-off-by: Alex Williamson — drivers/vfio/pci/vfio_pci.c | 13 ++++——— 1 file changed, 4 insertions(+), 9 deletions(-) diff –git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 6c11994..a4dc21b 100644 — a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -327,15 +327,10 @@ static long vfio_pci_ioctl(void *device_data, hdr.count > vfio_pci_get_irq_count(vdev, hdr.index)) return -EINVAL; …