diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 5e2bd7428424db79dc3af4141dadaab519f2688b..7b5cc16e4a0bbc4b61e0627df7bee1479fbda2f4 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -928,7 +928,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) */ switch (ctrl->bRequestType & USB_RECIP_MASK) { case USB_RECIP_INTERFACE: - f = cdev->config->interface[intf]; + if (cdev->config) + f = cdev->config->interface[intf]; break; case USB_RECIP_ENDPOINT: