summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2014-10-20 20:15:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-21 13:02:48 +0200
commit672a4972dddaa248611a358bce6118b60bce49e9 (patch)
treee3cb176d7612f0a9b04abb5df0cf0fddecb8c5bc
parentc677976c07676024c1bd1eb0058128611b96ecbd (diff)
downloadbarebox-672a4972dddaa248611a358bce6118b60bce49e9.tar.gz
barebox-672a4972dddaa248611a358bce6118b60bce49e9.tar.xz
dfu: fix possible usage of uninitialized var
The error path would in fact use the status variable without it being initialized first. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/gadget/dfu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 67a0703ca..351b58479 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -207,6 +207,7 @@ dfu_bind(struct usb_configuration *c, struct usb_function *f)
dfu->dnreq = usb_ep_alloc_request(c->cdev->gadget->ep0);
if (!dfu->dnreq) {
printf("usb_ep_alloc_request failed\n");
+ status = -ENOMEM;
goto out;
}
dfu->dnreq->buf = dma_alloc(CONFIG_USBD_DFU_XFER_SIZE);