mirror of https://gitee.com/openkylin/linux.git
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. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
93571adbb1
commit
5c73e74034
|
@ -1429,7 +1429,8 @@ static int __init msm_otg_probe(struct platform_device *pdev)
|
||||||
motg->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
|
motg->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
|
||||||
if (!motg->phy.otg) {
|
if (!motg->phy.otg) {
|
||||||
dev_err(&pdev->dev, "unable to allocate msm_otg\n");
|
dev_err(&pdev->dev, "unable to allocate msm_otg\n");
|
||||||
return -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
goto free_motg;
|
||||||
}
|
}
|
||||||
|
|
||||||
motg->pdata = dev_get_platdata(&pdev->dev);
|
motg->pdata = dev_get_platdata(&pdev->dev);
|
||||||
|
|
Loading…
Reference in New Issue