linux-imx/drivers/usb
Jia-Ju Bai c2ddb5852a USB: serial: io_edgeport: fix possible sleep-in-atomic
commit c7b8f77872 upstream.

According to drivers/usb/serial/io_edgeport.c, the driver may sleep
under a spinlock.
The function call path is:
edge_bulk_in_callback (acquire the spinlock)
   process_rcvd_data
     process_rcvd_status
       change_port_settings
         send_iosp_ext_cmd
           write_cmd_usb
             usb_kill_urb --> may sleep

To fix it, the redundant usb_kill_urb() is removed from the error path
after usb_submit_urb() fails.

This possible bug is found by my static analysis tool (DSAC) and checked
by my code review.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2018-06-01 00:30:05 +01:00
..
atm USB: cxacru: potential underflow in cxacru_cm_get_array() 2013-05-30 14:35:04 +01:00
c67x00 usb: Add module.h to drivers/usb consumers who really use it. 2011-10-31 19:31:25 -04:00
class usb: cdc_acm: Add quirk for Elatec TWN3 2018-01-01 20:50:59 +00:00
core usb: Add device quirk for Logitech HD Pro Webcam C925e 2018-03-03 15:50:51 +00:00
dwc3 usb: dwc3: gadget: make Set Endpoint Configuration macros safe 2017-07-18 18:38:30 +01:00
early USB: echi-dbgp: increase the controller wait time to come out of halt. 2012-08-10 00:25:07 +01:00
gadget USB: dummy-hcd: Fix deadlock caused by disconnect detection 2018-01-01 20:50:56 +00:00
host xhci: Don't add a virt_dev to the devs array before it's fully allocated 2018-03-03 15:50:45 +00:00
image atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
misc usb: usbtest: fix NULL pointer dereference 2017-11-11 13:34:40 +00:00
mon USB: fix usbmon BUG trigger 2018-03-03 15:50:57 +00:00
musb usb: musb: tusb6010_omap: Do not reset the other direction's packet size 2017-09-15 18:30:45 +01:00
otg usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
renesas_usbhs usb: renesas_usbhs: tidyup original usbhsx_for_each_xxx macro 2018-03-19 18:58:23 +00:00
serial USB: serial: io_edgeport: fix possible sleep-in-atomic 2018-06-01 00:30:05 +01:00
storage USB: uas and storage: Add US_FL_BROKEN_FUA for another JMicron JMS567 ID 2018-03-03 15:50:45 +00:00
wusbcore USB: wusbcore: fix NULL-deref at probe 2017-07-18 18:38:32 +01: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: Provide usb_speed_string() function 2011-09-18 01:29:04 -07:00
README
usb-common.c usb: Provide usb_speed_string() function 2011-09-18 01:29:04 -07:00
usb-skeleton.c USB: use usb_endpoint_maxp() instead of le16_to_cpu() 2011-08-23 09:47:40 -07:00

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.