Author: Julia Lawall <julia@diku.dk> Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret < 0\) || ...) { ... return ...; …
Catégorie : Linux
Aug 05 2012
drivers/gpio/gpio-langwell.c: fix error return code
Author: Julia Lawall <julia@diku.dk> Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret < 0\) || ...) { ... return ...; …
Aug 05 2012
drivers/atm/iphase.c: fix error return code
Author: Julia Lawall <julia@diku.dk> Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret < 0\) || ...) { ... return ...; …
Aug 05 2012
arch/powerpc/kvm/e500_tlb.c: fix error return code
Author: Julia Lawall <julia@diku.dk> Convert a 0 error return code to a negative one, as returned elsewhere in the function. A new label is also added to avoid freeing things that are known to not yet be allocated. A simplified version of the semantic match that finds the first problem is as follows: (http://coccinelle.lip6.fr/) // …
Aug 05 2012
mtd: spear_smi: use devm_ functions consistently
Author: Julia Lawall <Julia.Lawall@lip6.fr> Use devm_kzalloc for all calls to kzalloc and not just the first. Use devm functions for other allocations as well. Move the call to platform_get_resource(pdev, IORESOURCE_MEM, 0) closer to where its result is passed to devm_request_and_ioremap to make the lack of need for a NULL test more evident. The semantic match …
Aug 04 2012
drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc’d data
Author: Julia Lawall <Julia.Lawall@lip6.fr> devm_kfree should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,d; @@ x = devm_kzalloc(…) … ?-devm_kfree(d,x); // Signed-off-by: Julia Lawall Signed-off-by: Linus Walleij — drivers/pinctrl/pinctrl-nomadik.c | 1 – 1 file changed, 1 deletion(-) diff –git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c …
Aug 04 2012
drivers/char/hw_random/octeon-rng.c: drop frees of devm allocated data
Author: Julia Lawall <Julia.Lawall@lip6.fr> devm_kfree and devm_iounmap should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,d; @@ x = devm_kzalloc(…) … ?-devm_kfree(d,x); // Signed-off-by: Julia Lawall Signed-off-by: Herbert Xu — drivers/char/hw_random/octeon-rng.c | 17 +++++———— 1 file changed, 5 insertions(+), 12 deletions(-) …
Aug 04 2012
mfd: palmas: Drop kfree of devm_kzalloc’s data
Author: Julia Lawall <Julia.Lawall@lip6.fr> Using kfree to free data allocated with devm_kzalloc causes double frees. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ x = devm_kzalloc(…) … ?-kfree(x); // Signed-off-by: Julia Lawall Signed-off-by: Samuel Ortiz — drivers/mfd/palmas.c | 1 – 1 file changed, 1 deletion(-) diff …
Aug 04 2012
drivers/video/auo_k190x.c: drop kfree of devm_kzalloc’s data
Author: Julia Lawall <Julia.Lawall@lip6.fr> Using kfree to free data allocated with devm_kzalloc causes double frees. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ x = devm_kzalloc(…) … ?-kfree(x); // Signed-off-by: Julia Lawall Signed-off-by: Florian Tobias Schandinat — drivers/video/auo_k190x.c | 2 — 1 file changed, 2 deletions(-) …
Aug 04 2012
drivers/dma/sirf-dma.c: fix usage of devm functions
Author: Julia Lawall <Julia.Lawall@lip6.fr> Fix some problems with the use of devm_ functions. devm_kzalloc: devm_kfree is not needed devm_ioremap: iounmap should not be used, no free is needed devm_request_irq: the devm_free_irq is followed by irq_dispose_mapping. I don’t know if it is safe to move the freeing of the irq in this case, so I have …