summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/composite.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 024bba4345ed..e83078379b37 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2,7 +2,7 @@
* composite.c - infrastructure for Composite USB Gadgets
*
* Copyright (C) 2006-2008 David Brownell
- * Copyright (c) 2013 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2015 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1520,6 +1520,9 @@ void composite_disconnect(struct usb_gadget *gadget)
/* REVISIT: should we have config and device level
* disconnect callbacks?
*/
+ if (!cdev)
+ return;
+
spin_lock_irqsave(&cdev->lock, flags);
if (cdev->config)
reset_config(cdev);