public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Libo Chen <clbchenlibo.chen@huawei.com>
To: <grant.likely@linaro.org>, <rob.herring@calxeda.com>
Cc: <linux-mips@linux-mips.org>, LKML <linux-kernel@vger.kernel.org>,
	<devicetree-discuss@lists.ozlabs.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] usb: omap2430: fix memleak in err case
Date: Wed, 15 May 2013 09:35:12 +0800	[thread overview]
Message-ID: <5192E650.3070303@huawei.com> (raw)


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


             reply	other threads:[~2013-05-15  1:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15  1:35 Libo Chen [this message]
2013-05-15 11:55 ` [PATCH] usb: omap2430: fix memleak in err case Sergei Shtylyov
2013-05-17  4:49   ` Libo Chen
2013-05-22  3:30 ` [PATCH v2] " Libo Chen
2013-05-28 12:41   ` Libo Chen
2013-05-28 15:34     ` Andy Shevchenko
2013-05-29  0:52       ` Libo Chen
2013-05-28 17:40   ` Sergei Shtylyov
2013-05-29  2:47     ` Libo Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5192E650.3070303@huawei.com \
    --to=clbchenlibo.chen@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=rob.herring@calxeda.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox