[PATCH 2/3] gadget: at91: Fix uninitialized variable

Alexander Shiyan shc_work at mail.ru
Mon Oct 21 13:48:24 EDT 2013


Variable udc is used unitialized for DBG(xxx).

Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
 drivers/usb/gadget/at91_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index a11379c..acd9e44 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -414,6 +414,8 @@ static int at91_ep_queue(struct usb_ep *_ep,
 	req = container_of(_req, struct at91_request, req);
 	ep = container_of(_ep, struct at91_ep, ep);
 
+	udc = ep->udc;
+
 	if (!_req || !_req->complete
 			|| !_req->buf || !list_empty(&req->queue)) {
 		DBG(udc, "invalid request\n");
@@ -425,8 +427,6 @@ static int at91_ep_queue(struct usb_ep *_ep,
 		return -EINVAL;
 	}
 
-	udc = ep->udc;
-
 	if (!udc || !udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) {
 		DBG(udc, "invalid device\n");
 		return -EINVAL;
-- 
1.8.1.5




More information about the barebox mailing list