public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent@lvivier.info>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] swim: Release memory region after incorrect return/goto
Date: Tue, 04 Jun 2013 20:25:35 +0200	[thread overview]
Message-ID: <51AE311F.5060900@lvivier.info> (raw)
In-Reply-To: <60123fd3175b7cceadf6c335b12e58b797e18f65.1370356776.git.joe@perches.com>

Le 04/06/2013 16:44, Joe Perches a écrit :
> The code uses
>
> 	return foo;
> 	goto err_type;
>
> when instead the form should have been
>
> 	ret = foo;
> 	goto err_type;
>
> Here this causes a useful release_mem_region to be skipped.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>   drivers/block/swim.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/swim.c b/drivers/block/swim.c
> index 2f445b7..8ed6ccb 100644
> --- a/drivers/block/swim.c
> +++ b/drivers/block/swim.c
> @@ -893,7 +893,7 @@ static int swim_probe(struct platform_device *dev)
>   
>   	swim_base = ioremap(res->start, resource_size(res));
>   	if (!swim_base) {
> -		return -ENOMEM;
> +		ret = -ENOMEM;
>   		goto out_release_io;
>   	}
>   

Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>

      parent reply	other threads:[~2013-06-04 18:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 14:44 [PATCH 1/4] swim: Release memory region after incorrect return/goto Joe Perches
2013-06-04 14:44 ` [PATCH 2/4] inkern: iio_device_put " Joe Perches
2013-06-04 17:28   ` Jonathan Cameron
2013-06-04 14:44 ` [PATCH 3/4] mtd: onenand: samsung: Release memory " Joe Perches
2013-06-04 14:44 ` [PATCH 4/4] cw1200: hwio: Remove an unnecessary goto Joe Perches
2013-06-04 15:09   ` Solomon Peachy
2013-06-04 18:25 ` Laurent Vivier [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=51AE311F.5060900@lvivier.info \
    --to=laurent@lvivier.info \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.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