]> git.baikalelectronics.ru Git - kernel.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)
commit7f4a05bba82fe8074a3505c2d9122520bbd9d63a
treed8ccc58cefff899c37ae0854b76c4e3ff467aa56
parent8279ff101382ead8c710eb47d79da48bdf6bc761
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