linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haojian Zhuang <hzhuang1@marvell.com>
To: Eric Miao <eric.y.miao@gmail.com>, Axel Lin <axel.lin@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pcmcia@lists.infradead.org"
	<linux-pcmcia@lists.infradead.org>
Subject: RE: [PATCH RESEND] ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe
Date: Tue, 27 Dec 2011 01:18:59 -0800	[thread overview]
Message-ID: <25B60CDC2F704E4E9D88FFD52780CB4C05EC64DBD3@SC-VEXCH1.marvell.com> (raw)
In-Reply-To: <CAMPhdO_QL3ahf4+F70Bg7FHKq5mrbbofN_BTz8dpcBLea9BNAw@mail.gmail.com>


________________________________________
From: Eric Miao [eric.y.miao@gmail.com]
Sent: Tuesday, December 27, 2011 5:11 PM
To: Axel Lin
Cc: linux-kernel@vger.kernel.org; Haojian Zhuang; Russell King; linux-arm-kernel@lists.infradead.org; linux-pcmcia@lists.infradead.org
Subject: Re: [PATCH RESEND] ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe

On Tue, Dec 27, 2011 at 4:25 PM, Axel Lin <axel.lin@gmail.com> wrote:
> 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>

Acked-by: Eric Miao <eric.y.miao@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
>
>
>
Wait a minute.

The original code will check whether pxa2xx_drv_pcmcia_add_one() successful. If it fails, we'll remove all devices that we registered.

But Axel removed these code. Why?

Thanks
Haojian

  reply	other threads:[~2011-12-27  9:22 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 [this message]
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=25B60CDC2F704E4E9D88FFD52780CB4C05EC64DBD3@SC-VEXCH1.marvell.com \
    --to=hzhuang1@marvell.com \
    --cc=axel.lin@gmail.com \
    --cc=eric.y.miao@gmail.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).