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 d0ee7847b9..a87639def9 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -838,6 +838,9 @@ unknown:
ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length);
+ if (!cdev->config)
+ goto done;
+
/*
* functions always handle their interfaces and endpoints...
* punt other recipients (other, WUSB, ...) to the current
@@ -882,7 +885,7 @@ unknown:
value = f->setup(f, ctrl);
else {
c = cdev->config;
- if (c && c->setup)
+ if (c->setup)
value = c->setup(c, ctrl);
}