usb: gadget: android: Cancel pending ctrlrequest before disabling
authorBenoit Goby <benoit@android.com>
Tue, 29 Nov 2011 21:49:27 +0000 (13:49 -0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 19 Dec 2011 02:12:58 +0000 (10:12 +0800)
commit03af99cfe3f3379995b3c18576e9bb97d054e250
tree6e9441562df8f8009933be7f78012044fff0324c
parent66d9d297206ede31688ce9c2d7b0c2c3c26ff35d
usb: gadget: android: Cancel pending ctrlrequest before disabling

Make sure there is no pending ctrlrequest before removing the config.
Otherwise the ctrlrequest complete callback could access structures
after they have been freed. Unbind cancels pending transfers but not
ep0 requests.

Bug: 5513065 5440193

Change-Id: I063c22bf5d104a3d2df71cf622409459fac5f27a
Signed-off-by: Benoit Goby <benoit@android.com>
drivers/usb/gadget/android.c