]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
usb: gadget: udc-core: fix a regression during gadget driver unbinding
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 15 Mar 2013 18:02:14 +0000 (14:02 -0400)
committerFelipe Balbi <balbi@ti.com>
Wed, 20 Mar 2013 14:46:33 +0000 (16:46 +0200)
commit511f3c5326eabe1ece35202a404c24c0aeacc246
treed8ccc58cefff899c37ae0854b76c4e3ff467aa56
parent699412d951e6dd4dec48db88f33dc27b361582f0
usb: gadget: udc-core: fix a regression during gadget driver unbinding

This patch (as1666) fixes a regression in the UDC core.  The core
takes care of unbinding gadget drivers, and it does the unbinding
before telling the UDC driver to turn off the controller hardware.
When the call to the udc_stop callback is made, the gadget no longer
has a driver.  The callback routine should not be invoked with a
pointer to the old driver; doing so can cause problems (such as
use-after-free accesses in net2280).

This patch should be applied, with appropriate context changes, to all
the stable kernels going back to 3.1.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc-core.c