Skip to contentSkip to conversation

usb: phy: msm: tiny leak on error in probe()

PATCH New Dan Carpenter 1 participant 1 message Jan 21, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: phy: msm: tiny leak on error in probe()

Free "motog" on error. This is more to appease the static checkers than a real worry.

drivers/usb/phy/phy-msm-usb.c +2 -1
index 8546c8dccd51..64c9d14ea77d 100644
@@ -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);