linux/drivers/usb/dwc3
Julia Lawall 5632c827cb drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree
Glue needs to be freed on exiting the function in an error case.
Furthermore, pci, which is the first argument to the probe function should
not be freed before leaveing the function, as it is reused at the call
site.  So the free of pci is changed to free glue instead.

A simplified version of the semantic match that finds the problem is as
follows: (http://coccinelle.lip6.fr)

// <smpl>
@r exists@
local idexpression x;
statement S;
identifier f1;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 15:52:42 -08:00
..
core.c usb: dwc3: use correct hwparam register for power mgm check 2011-12-12 11:48:44 +02:00
core.h usb: dwc3: gadget: fix stream enable bit 2011-12-12 11:48:47 +02:00
debug.h usb: dwc: remove "All rights reserved" statement. 2011-10-04 10:25:52 -07:00
debugfs.c usb: dwc3: fix sparse errors 2011-12-12 11:48:29 +02:00
dwc3-omap.c Merge branch 'for-next/dwc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next 2011-12-12 15:19:53 -08:00
dwc3-pci.c drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree 2012-01-04 15:52:42 -08:00
ep0.c usb: dwc3: ep0: fix for possible early delayed_status 2011-12-12 11:48:47 +02:00
gadget.c usb: ch9: fix up MaxStreams helper 2012-01-04 15:52:42 -08:00
gadget.h usb: dwc3: ep0: use dwc3_request for ep0 requsts instead of usb_request 2011-12-12 11:48:45 +02:00
host.c usb: dwc3: host: remove unused includes 2011-12-12 11:48:19 +02:00
io.h usb: dwc3: fix few coding style problems 2011-12-12 11:48:29 +02:00
Kconfig usb: dwc3: depend on both Host and Gadget stacks 2011-12-12 11:48:14 +02:00
Makefile usb: dwc3: always compile gadget side too 2011-12-12 11:48:13 +02:00