From: Alexander Shishkin Date: Fri, 4 May 2012 13:47:14 +0000 (+0300) Subject: usb: gadget: ci13xxx: fix ep list removal in gadget unregistering code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=efa015bbc410198a192cd3e504ce24104e8c8852;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git usb: gadget: ci13xxx: fix ep list removal in gadget unregistering code Since ep0{out,in} are never on gadget's ep_list, there's no need to try to unlink them, even more so because ep_list linkage is not initialized for these endpoints. Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 1a44bf9c374f..b6f359ce157d 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c @@ -2737,7 +2737,7 @@ static int ci13xxx_stop(struct usb_gadget_driver *driver) for (i = 0; i < hw_ep_max; i++) { struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i]; - if (!list_empty(&mEp->ep.ep_list)) + if (mEp->num) list_del_init(&mEp->ep.ep_list); if (mEp->qh.ptr != NULL)