linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Axel Lin <axel.lin@gmail.com>,
	linux-kernel@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>,
	linux-pcmcia@lists.infradead.org,
	Eric Miao <eric.y.miao@gmail.com>,
	Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: Re: [PATCH RESEND] ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe
Date: Tue, 27 Dec 2011 16:24:33 +0100	[thread overview]
Message-ID: <201112271624.33760.marek.vasut@gmail.com> (raw)
In-Reply-To: <1324974344.2351.5.camel@phoenix>

> 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;

Makes sense

Acked-by: Marek Vasut <marek.vasut@gmail.com>

      parent reply	other threads:[~2011-12-27 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27  8:25 [PATCH RESEND] ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe Axel Lin
2011-12-27  9:11 ` 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 [this message]

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=201112271624.33760.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=axel.lin@gmail.com \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    /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).