mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Libo Chen <libo.chen@huawei.com>
To: <stern@rowland.harvard.edu>, <grant.likely@linaro.org>,
	<rob.herring@calxeda.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<akpm@linux-foundation.org>, <lizefan@huawei.com>,
	Libo Chen <libo.chen@huawei.com>
Subject: [PATCH RESEND 2/4] usb: isp1760-if: fix memleak when platform_get_resource fail
Date: Thu, 9 May 2013 14:05:35 +0800	[thread overview]
Message-ID: <1368079537-15328-3-git-send-email-libo.chen@huawei.com> (raw)
In-Reply-To: <1368079537-15328-1-git-send-email-libo.chen@huawei.com>

When platform_get_resource fail, we should release_mem_region

Signed-off-by: Libo Chen <libo.chen@huawei.com>
---
 drivers/usb/host/isp1760-if.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index bbb791b..a13709e 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -373,8 +373,10 @@ static int isp1760_plat_probe(struct platform_device *pdev)
 	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (!irq_res) {
 		pr_warning("isp1760: IRQ resource not available\n");
-		return -ENODEV;
+		ret = -ENODEV;
+		goto cleanup;
 	}
+
 	irqflags |= irq_res->flags & IRQF_TRIGGER_MASK;
 
 	if (priv) {
-- 
1.7.1



  parent reply	other threads:[~2013-05-09  6:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09  6:05 [PATCH RESEND 0/4] usb: fix four memleak Libo Chen
2013-05-09  6:05 ` [PATCH RESEND 1/4] usb: ehci-s5p: fix memleak when devm_usb_get_phy fail Libo Chen
2013-05-09 19:29   ` Alan Stern
2013-05-09  6:05 ` Libo Chen [this message]
2013-05-09  6:05 ` [PATCH RESEND 3/4] usb: ohci: fix goto wrong tag in err case Libo Chen
2013-05-09 19:27   ` Alan Stern
2013-05-09  6:05 ` [PATCH RESEND 4/4] usb: tilegx: fix memleak when create hcd fail Libo Chen
2013-05-09 18:02   ` Chris Metcalf
2013-05-10  1:09     ` Libo Chen
2013-05-10  1:50       ` Libo Chen
2013-05-09 19:29   ` Alan Stern

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=1368079537-15328-3-git-send-email-libo.chen@huawei.com \
    --to=libo.chen@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=rob.herring@calxeda.com \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®