From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 2/2] jz4740-adc: fix resource reclaim in jz4740_adc_probe error path
Date: Thu, 29 Jul 2010 16:28:25 +0800 [thread overview]
Message-ID: <1280392105.21676.6.camel@mola> (raw)
If mfd_add_devices() fail, we need to relese allocated resources.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
This patch is against linux-next.
drivers/mfd/jz4740-adc.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/mfd/jz4740-adc.c b/drivers/mfd/jz4740-adc.c
index 2846d24..3ad492c 100644
--- a/drivers/mfd/jz4740-adc.c
+++ b/drivers/mfd/jz4740-adc.c
@@ -326,9 +326,15 @@ static int __devinit jz4740_adc_probe(struct platform_device *pdev)
writeb(0x00, adc->base + JZ_REG_ADC_ENABLE);
writeb(0xff, adc->base + JZ_REG_ADC_CTRL);
- return mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells,
+ ret = mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells,
ARRAY_SIZE(jz4740_adc_cells), mem_base, adc->irq_base);
+ if (ret < 0)
+ goto err_clk_put;
+ return 0;
+
+err_clk_put:
+ clk_put(adc->clk);
err_iounmap:
platform_set_drvdata(pdev, NULL);
iounmap(adc->base);
--
1.5.4.3
next reply other threads:[~2010-07-29 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-29 8:28 Axel Lin [this message]
2010-08-01 22:43 ` [PATCH 2/2] jz4740-adc: fix resource reclaim in jz4740_adc_probe error path Samuel Ortiz
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=1280392105.21676.6.camel@mola \
--to=axel.lin@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.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