Category: Linux

USB: skeleton: Correct use of ! and &

Author: Julia Lawall <julia@diku.dk> Correct priority problem in the use of ! and &. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression E; constant C; @@ – !E & C + !(E & C) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/usb/usb-skeleton.c | 4 ++– 1 file changed, …

Continue reading

i2c-pnx: Correct use of request_region/request_mem_region

Author: Julia Lawall <julia@diku.dk> request_mem_region should be used when ioremap is used subsequently. release_region is then correspondingly replaced by release_mem_region. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ expression start,E; @@ – request_region + request_mem_region (start,…) … when != request_mem_region(start,…) when != start = E ioremap(start,…) @@ expression r.start; @@ …

Continue reading

V4L/DVB (13012): uvc: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Move the kzalloc and associated test after the stream/query test, to avoid the need to free the allocated if the stream/query test fails. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != …

Continue reading

hwmon: Use resource_size

Author: Julia Lawall <julia@diku.dk> Use the function resource_size, which reduces the chance of introducing off-by-one errors in calculating the resource size. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct resource *res; @@ – (res->end – res->start) + 1 + resource_size(res) // Signed-off-by: Julia Lawall Signed-off-by: Jean Delvare — drivers/hwmon/pc87427.c …

Continue reading

MIPS: TXx9: Fix error handling.

Author: Julia Lawall <julia@diku.dk> Error handling code following a kzalloc should free the allocated data. Error handling code following an ioremap should iounmap the allocated data. The semantic match that finds the first problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != …

Continue reading

x86: apic: Convert BUG() to BUG_ON()

Author: Daniel Walker <dwalker@fifo99.com> This was done using Coccinelle’s BUG_ON semantic patch. Signed-off-by: Daniel Walker Cc: Julia Lawall LKML-Reference: Signed-off-by: Ingo Molnar — arch/x86/kernel/apic/apic.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 159740d..79e5b92 100644 — a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1196,8 +1196,7 @@ void __cpuinit setup_local_APIC(void) * Double-check …

Continue reading

ASoC: Clean up error handling in MPC5200 DMA setup

Author: Julia Lawall <julia@diku.dk> Error handling code following a kzalloc should free the allocated data. Error handling code following an ioremap should iounmap the allocated data. The semantic match that finds the first problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != …

Continue reading

Staging: iio: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc or kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…); … if (x == NULL) …

Continue reading

Staging: dream: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc or kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…); … if (x == NULL) …

Continue reading

drivers/net/phy: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…); … if (x == NULL) S f1 …

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.