usb: phy: msm: tiny leak on error in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 21 Jan 2014 06:50:51 +0000 (09:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 22:41:05 +0000 (14:41 -0800)
Free "motog" on error.  This is more to appease the static checkers than
a real worry.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/phy/phy-msm-usb.c

index 8546c8dccd51b003fc9aba3038184cd2d0eedbea..64c9d14ea77dce12306c1ff3e93a3bf7c651c90c 100644 (file)
@@ -1429,7 +1429,8 @@ static int __init msm_otg_probe(struct platform_device *pdev)
        motg->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
        if (!motg->phy.otg) {
                dev_err(&pdev->dev, "unable to allocate msm_otg\n");
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto free_motg;
        }
 
        motg->pdata = dev_get_platdata(&pdev->dev);