From: axel.lin@gmail.com (Axel Lin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND] ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe
Date: Tue, 27 Dec 2011 16:25:44 +0800 [thread overview]
Message-ID: <1324974344.2351.5.camel@phoenix> (raw)
If pxa2xx_drv_pcmcia_add_one fails, it will go to err1 error path.
Add a missing clk_put in the error path.
Checking the ret value after the for loop is redundant, it is always false.
Thus remove the redundant checking.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/pcmcia/pxa2xx_base.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index a87e272..64d433e 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -328,21 +328,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
goto err1;
}
- if (ret) {
- while (--i >= 0)
- soc_pcmcia_remove_one(&sinfo->skt[i]);
- kfree(sinfo);
- clk_put(clk);
- } else {
- pxa2xx_configure_sockets(&dev->dev);
- dev_set_drvdata(&dev->dev, sinfo);
- }
+ pxa2xx_configure_sockets(&dev->dev);
+ dev_set_drvdata(&dev->dev, sinfo);
return 0;
err1:
while (--i >= 0)
soc_pcmcia_remove_one(&sinfo->skt[i]);
+ clk_put(clk);
kfree(sinfo);
err0:
return ret;
--
1.7.5.4
next reply other threads:[~2011-12-27 8:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-27 8:25 Axel Lin [this message]
2011-12-27 9:11 ` [PATCH RESEND] ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe Eric Miao
2011-12-27 9:18 ` Haojian Zhuang
2011-12-27 9:25 ` Eric Miao
2011-12-28 1:04 ` Haojian Zhuang
2012-02-02 1:59 ` Axel Lin
2011-12-27 15:24 ` Marek Vasut
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=1324974344.2351.5.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).