diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 92467eea76defb245ad4fbe4f3c65973c90b610f..d82d0068872b238b6cf6d5b8dbaa32e37b20a43f 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -402,6 +402,9 @@ static inline void usb_ep_free_request(struct usb_ep *ep, static inline int usb_ep_queue(struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) { + if (WARN_ON_ONCE(!ep->enabled && ep->address)) + return -ESHUTDOWN; + return ep->ops->queue(ep, req, gfp_flags); }