Message ID | 20200830183646.24930-1-trix@redhat.com |
---|---|
State | New |
Headers | show |
Series | usb: gadget: net2272: assert for a valid dma request | expand |
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index 44d1ea2307bb..8301723a8b1a 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c @@ -1506,17 +1506,16 @@ static int net2272_stop(struct usb_gadget *_gadget) static void net2272_handle_dma(struct net2272_ep *ep) { - struct net2272_request *req; + struct net2272_request *req = NULL; unsigned len; int status; if (!list_empty(&ep->queue)) req = list_entry(ep->queue.next, struct net2272_request, queue); - else - req = NULL; dev_vdbg(ep->dev->dev, "handle_dma %s req %p\n", ep->ep.name, req); + BUG_ON(!req); /* Ensure DREQ is de-asserted */ net2272_write(ep->dev, DMAREQ,