Merge "usb: gadget: Do not disconnect unregistered dev"

This commit is contained in:
Linux Build Service Account 2016-11-11 20:05:50 -08:00 committed by Gerrit - the friendly Code Review server
commit 2d320e52f7

View file

@ -1528,7 +1528,14 @@ static int android_setup(struct usb_gadget *gadget,
static void android_disconnect(struct usb_gadget *gadget)
{
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct gadget_info *gi = container_of(cdev, struct gadget_info, cdev);
struct gadget_info *gi;
if (!cdev) {
pr_err("%s: gadget is not connected\n", __func__);
return;
}
gi = container_of(cdev, struct gadget_info, cdev);
/* accessory HID support can be active while the
accessory function is not actually enabled,