• Alan Stern's avatar
    usb: gadget: udc-core: fix a regression during gadget driver unbinding · 0d631c84
    Alan Stern authored
    commit 511f3c53 upstream.
    
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    [bwh: Backported to 3.2: adjust context, indentation]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    0d631c84
udc-core.c 11.9 KB