[PATCH 2/7] dfu: fix possible usage of uninitialized var

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The error path would in fact use the status
variable without it being initialized first.

Signed-off-by: Lucas Stach <dev@xxxxxxxxxx>
---
 drivers/usb/gadget/dfu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 67a0703..351b584 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);
-- 
1.9.3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux