1
0
Fork 0
alistair23-linux/drivers/usb
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
..
atm drivers: usb: atm: ueagle-atm: Add missing const qualifier 2011-07-08 14:51:30 -07:00
c67x00 usb: convert drivers/usb/* to use module_platform_driver() 2011-11-28 06:48:32 +09:00
class usb: cdc-acm: Kill ACM_READY() macro completely 2011-12-09 19:33:48 -08:00
core USB: remove dead code from suspend/resume path 2012-01-03 16:49:28 -08:00
dwc3 drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree 2012-01-04 15:52:42 -08:00
early USB: EHCI: Support controllers with big endian capability regs 2011-05-03 11:43:21 -07:00
gadget Merge branch 'for-gadget/next' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next 2011-12-22 14:05:19 -08:00
host drivers/usb/host/isp1760-if.c: introduce missing kfree 2012-01-04 15:52:42 -08:00
image atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
misc USB: isight: fix kernel bug when loading firmware 2011-12-09 16:18:19 -08:00
mon usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
musb Merge branch 'for-next/musb' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next 2011-12-22 13:59:59 -08:00
otg Merge branch 'for-gadget/next' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next 2011-12-22 14:05:19 -08:00
renesas_usbhs Merge branch 'for-gadget/next' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next 2011-12-22 14:05:19 -08:00
serial usb: option: add ZD Incorporated HSPA modem 2012-01-04 15:52:42 -08:00
storage 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
wusbcore drivers: usb: wusbcore: Fix dependency for USB_WUSB 2012-01-03 16:48:15 -08:00
Kconfig Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2011-11-03 13:28:14 -07:00
Makefile USB: OTG should be linked before Host 2011-11-26 19:58:47 -08:00
README
usb-common.c usb: Provide usb_speed_string() function 2011-09-18 01:29:04 -07:00
usb-skeleton.c USB: usb-skeleton.c: cleanup open_count 2012-01-04 15:52:41 -08:00

README

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("khubd").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.