mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
e281cf8966
Error handling code following a kzalloc should free the allocated data. Similarly for usb-alloc urb. The semantic match that finds the first problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @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 <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
||
---|---|---|
.. | ||
altpciechdma | ||
arlan | ||
asus_oled | ||
b3dfg | ||
batman-adv | ||
comedi | ||
cx25821 | ||
dream | ||
echo | ||
et131x | ||
frontier | ||
go7007 | ||
hv | ||
iio | ||
line6 | ||
mimio | ||
netwave | ||
octeon | ||
otus | ||
p9auth | ||
panel | ||
phison | ||
poch | ||
pohmelfs | ||
quatech_usb2 | ||
ramzswap | ||
rar | ||
rt2860 | ||
rt2870 | ||
rt3070 | ||
rt3090 | ||
rtl8187se | ||
rtl8192e | ||
rtl8192su | ||
rtl8192u | ||
samsung-laptop | ||
sep | ||
serqt_usb2 | ||
slicoss | ||
sm7xx | ||
strip | ||
udlfb | ||
usbip | ||
vme | ||
vt6655 | ||
vt6656 | ||
wavelan | ||
winbond | ||
wlags49_h2 | ||
wlags49_h25 | ||
wlan-ng | ||
Kconfig | ||
Makefile | ||
staging.c |