public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ACPI / resources: free memory on error in add_region_before()
Date: Wed, 24 Jun 2015 23:57:52 +0200	[thread overview]
Message-ID: <1965684.FcqIK5OKHD@vostro.rjw.lan> (raw)
In-Reply-To: <20150624143015.GD1702@mwanda>

On Wednesday, June 24, 2015 05:30:15 PM Dan Carpenter wrote:
> There is a small memory leak on error.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks!

> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index fcb7807..10561ce 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -660,8 +660,10 @@ static int add_region_before(u64 start, u64 end, u8 space_id,
>  		return -ENOMEM;
>  
>  	error = request_range(start, end, space_id, flags, desc);
> -	if (error)
> +	if (error) {
> +		kfree(reg);
>  		return error;
> +	}
>  
>  	reg->start = start;
>  	reg->end = end;

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      reply	other threads:[~2015-06-24 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24 14:30 [patch] ACPI / resources: free memory on error in add_region_before() Dan Carpenter
2015-06-24 21:57 ` Rafael J. Wysocki [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=1965684.FcqIK5OKHD@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@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