diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2016-02-08 11:54:50 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2016-02-12 20:13:36 +0530 |
commit | 7eff2ffe05a8b2c6c83a4f511ac6c31c858e3048 (patch) | |
tree | 180aeafde234ae6bb2363b646499843b994a6292 | |
parent | 2ba162c06307b66976040afce154bee7f74b42fc (diff) |
Revert "usb: gadget: composite: Fix corruption when changing configuration"lsk-v3.14-16.02-android
This reverts commit f5b96a704d06bc94b28a469c687a4ff14a6e630e.
We do not need this fix with Android ConfigFS gadgets.
Change-Id: I7dffb884a49ecb2f5d619150edfa3e51808ef8cc
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | drivers/usb/gadget/composite.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index ec3db31ee91a..82df926c765d 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -812,7 +812,7 @@ done: } EXPORT_SYMBOL_GPL(usb_add_config); -static void unbind_config(struct usb_composite_dev *cdev, +static void remove_config(struct usb_composite_dev *cdev, struct usb_configuration *config) { while (!list_empty(&config->functions)) { @@ -827,6 +827,7 @@ static void unbind_config(struct usb_composite_dev *cdev, /* may free memory for "f" */ } } + list_del(&config->list); if (config->unbind) { DBG(cdev, "unbind config '%s'/%p\n", config->label, config); config->unbind(config); @@ -853,11 +854,9 @@ void usb_remove_config(struct usb_composite_dev *cdev, if (cdev->config == config) reset_config(cdev); - list_del(&config->list); - spin_unlock_irqrestore(&cdev->lock, flags); - unbind_config(cdev, config); + remove_config(cdev, config); } /*-------------------------------------------------------------------------*/ @@ -1538,8 +1537,7 @@ static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver) struct usb_configuration *c; c = list_first_entry(&cdev->configs, struct usb_configuration, list); - list_del(&c->list); - unbind_config(cdev, c); + remove_config(cdev, c); } if (cdev->driver->unbind && unbind_driver) cdev->driver->unbind(cdev); |