public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Jesper Juhl <jj@chaosbits.net>, Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lin Ming <ming.m.lin@intel.com>
Subject: Re: [PATCH] ACPI: Fix memory leak in acpi_ev_asynch_execute_gpe_method().
Date: Sun, 16 Jan 2011 20:48:29 +0100	[thread overview]
Message-ID: <201101162048.29781.rjw@sisk.pl> (raw)
In-Reply-To: <alpine.LNX.2.00.1101162033531.13377@swampdragon.chaosbits.net>

On Sunday, January 16, 2011, Jesper Juhl wrote:
> We will leak the memory allocated to 'local_gpe_event_info' if 
> 'acpi_ut_acquire_mutex()' fails or if 'acpi_ev_valid_gpe_event()' fails in 
> drivers/acpi/acpica/evgpe.c::acpi_ev_asynch_execute_gpe_method().
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Good catch!  How did you find it?

Reviewed-by: Rafael Wysocki <rjw@sisk.pl>

Len, please apply and push to Linus ASAP.

Thanks,
Rafael


> ---
>  evgpe.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
> index 7c339d3..b6de1fb 100644
> --- a/drivers/acpi/acpica/evgpe.c
> +++ b/drivers/acpi/acpica/evgpe.c
> @@ -471,6 +471,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
>  
>  	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
>  	if (ACPI_FAILURE(status)) {
> +		ACPI_FREE(local_gpe_event_info);
>  		return_VOID;
>  	}
>  
> @@ -478,6 +479,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
>  
>  	if (!acpi_ev_valid_gpe_event(gpe_event_info)) {
>  		status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
> +		ACPI_FREE(local_gpe_event_info);
>  		return_VOID;
>  	}
>  
> 
> 


  reply	other threads:[~2011-01-16 19:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-16 19:37 [PATCH] ACPI: Fix memory leak in acpi_ev_asynch_execute_gpe_method() Jesper Juhl
2011-01-16 19:48 ` Rafael J. Wysocki [this message]
2011-01-16 19:51   ` Jesper Juhl
2011-01-17  1:47 ` Lin Ming
2011-01-17  4:20 ` Len Brown
2011-01-17 18:32   ` Jesper Juhl

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=201101162048.29781.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=jj@chaosbits.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    /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