aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/function/f_accessory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_accessory.c b/drivers/usb/gadget/function/f_accessory.c
index a2dc735a9438..a9bd90612986 100644
--- a/drivers/usb/gadget/function/f_accessory.c
+++ b/drivers/usb/gadget/function/f_accessory.c
@@ -1400,10 +1400,11 @@ void acc_disconnect(void)
1400{ 1400{
1401 struct acc_dev *dev = get_acc_dev(); 1401 struct acc_dev *dev = get_acc_dev();
1402 1402
1403 /* unregister all HID devices if USB is disconnected */ 1403 if (!dev)
1404 if (dev) 1404 return;
1405 kill_all_hid_devices(dev);
1406 1405
1406 /* unregister all HID devices if USB is disconnected */
1407 kill_all_hid_devices(dev);
1407 put_acc_dev(dev); 1408 put_acc_dev(dev);
1408} 1409}
1409EXPORT_SYMBOL_GPL(acc_disconnect); 1410EXPORT_SYMBOL_GPL(acc_disconnect);