summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2011-12-30 13:21:17 +0800
committerAndy Green <andy.green@linaro.org>2011-12-30 13:21:17 +0800
commit20b7b0bd9ac053511169225b174a1b5871e758b8 (patch)
tree90339df2b2eb0d12cef8c3671e53ea6589752486
parentc48e88ca7120c6daca4da31c35e6cc7bdb26dc4a (diff)
In composite_disconnect, it's possible to no longer have any valid gadget data for a gadget Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r--drivers/usb/gadget/composite.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index cf7ccd69c42..ce0e1716d92 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1333,6 +1333,9 @@ static void composite_disconnect(struct usb_gadget *gadget)
struct usb_composite_dev *cdev = get_gadget_data(gadget);
unsigned long flags;
+ if (cdev == NULL)
+ return;
+
/* REVISIT: should we have config and device level
* disconnect callbacks?
*/