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

Alexander Shiyan shc_work at mail.ru
Wed Jan 29 13:21:48 EST 2014


Variable udc is used unitialized for DBG(xxx).

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

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index acd9e44..6eeef7d 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1417,7 +1417,7 @@ static struct poller_struct poller = {
 
 static int __init at91udc_probe(struct device_d *dev)
 {
-	struct at91_udc	*udc;
+	struct at91_udc	*udc = &controller;
 	int		retval;
 
 	if (!dev->platform_data) {
@@ -1427,7 +1427,6 @@ static int __init at91udc_probe(struct device_d *dev)
 	}
 
 	/* init software state */
-	udc = &controller;
 	udc->dev = dev;
 	udc->board = *(struct at91_udc_data *) dev->platform_data;
 	udc->enabled = 0;
-- 
1.8.3.2




More information about the barebox mailing list