usb: gadget: atmel_usba_udc: add missing ret value check
authorRobert Baldyga <r.baldyga@samsung.com>
Mon, 13 Jul 2015 09:03:54 +0000 (11:03 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 31 Jul 2015 13:58:03 +0000 (08:58 -0500)
Add missing return value check. In case of error print debug message
and return error code.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/atmel_usba_udc.c

index 4095cce05e6a729ccf86ff5f6394e55f7cf0511f..37d414ec2d69094a847eef29fb9a3eff57f60a64 100644 (file)
@@ -1989,6 +1989,10 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
                ep->can_isoc = of_property_read_bool(pp, "atmel,can-isoc");
 
                ret = of_property_read_string(pp, "name", &name);
+               if (ret) {
+                       dev_err(&pdev->dev, "of_probe: name error(%d)\n", ret);
+                       goto err;
+               }
                ep->ep.name = name;
 
                ep->ep_regs = udc->regs + USBA_EPT_BASE(i);