devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: omap2430: fix memleak in err case
@ 2013-05-15  1:35 Libo Chen
  2013-05-15 11:55 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Libo Chen @ 2013-05-15  1:35 UTC (permalink / raw)
  To: grant.likely, rob.herring
  Cc: linux-mips, LKML, devicetree-discuss, Andrew Morton


when omap_get_control_dev fail, we should release relational platform_device

Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-17  4:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15  1:35 [PATCH] usb: omap2430: fix memleak in err case Libo Chen
2013-05-15 11:55 ` Sergei Shtylyov
2013-05-17  4:49   ` Libo Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).