diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index b314e7029e0..f195c0ed757 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -3220,15 +3220,15 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) irqstate_t flags; int ret = OK; + DEBUGASSERT(ed != NULL); + /* These first steps must be atomic as possible */ - flags = irqsave(); + flags = irqsave(); - /* It might be possible for no transfer to be in progress */ + /* It is possible there there is no transfer to be in progress */ - DEBUGASSERT(ed != NULL && ed->xfrinfo != NULL); xfrinfo = ed->xfrinfo; - if (xfrinfo) { /* It would be an usage error to use the interface to try to cancel a