[PATCH] usb: omap2430: fix memleak in err case

From: Libo Chen
Date: Tue May 14 2013 - 21:35:59 EST



when omap_get_control_dev fail, we should release relational platform_device

Signed-off-by: Libo Chen <libo.chen@xxxxxxxxxx>
---
drivers/usb/musb/omap2430.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 3551f1a..b626f19 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -549,7 +549,8 @@ static int omap2430_probe(struct platform_device *pdev)
glue->control_otghs = omap_get_control_dev();
if (IS_ERR(glue->control_otghs)) {
dev_vdbg(&pdev->dev, "Failed to get control device\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto err2;
}
} else {
glue->control_otghs = ERR_PTR(-ENODEV);
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/