usb: gadget: tegra: fix Coverity issue
Deepak Nibade [Tue, 3 Dec 2013 14:04:27 +0000 (19:04 +0530)]
fix Coverity issue of dereference after NULL check
Coverity id : 25261

Bug 1416640

Change-Id: I071dd86d87118c01b295efd687950017c461456f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/337817
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-by: Sumit Singh <sumsingh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>

drivers/usb/gadget/tegra_udc.c

index e373bab..8204428 100644 (file)
@@ -2847,8 +2847,11 @@ static int __init tegra_udc_probe(struct platform_device *pdev)
                else
                        udc->dcp_current_limit =
                                USB_CHARGING_DCP_CURRENT_LIMIT_UA;
-       } else
+       } else {
                dev_err(&pdev->dev, "failed to get platform_data\n");
+               err = -ENODATA;
+               goto err_irq;
+       }
 
        udc->phy = tegra_usb_phy_open(pdev);
        if (IS_ERR(udc->phy)) {