On Wed, 11 Apr 2012 12:50:52 +0300, Felipe Balbi <balbi@xxxxxx> wrote: > On Tue, Apr 10, 2012 at 05:25:10PM +0300, Alexander Shishkin wrote: > > 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 <alexander.shishkin@xxxxxxxxxxxxxxx> > > --- > > drivers/usb/gadget/ci13xxx_udc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c > > index 243ef1a..7e51aa9 100644 > > --- a/drivers/usb/gadget/ci13xxx_udc.c > > +++ b/drivers/usb/gadget/ci13xxx_udc.c > > @@ -2735,7 +2735,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) > > you should still make sure list isn't empty before trying to delete, > right ? Yes, but currently it can't be empty at this point. > so if (mEp->num && !list_empty(&mEp->ep.ep_list)) ?? Having said that, adding a list_empty() check doesn't serve any purpose. Regards, -- Alex -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html