From: Lin Ming <ming.m.lin@intel.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] ACPI: Fix memory leak in acpi_ev_asynch_execute_gpe_method().
Date: Mon, 17 Jan 2011 09:47:11 +0800 [thread overview]
Message-ID: <1295228831.28388.84.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1101162033531.13377@swampdragon.chaosbits.net>
On Mon, 2011-01-17 at 03:37 +0800, 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>
> ---
> 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;
> }
>
>
Acked-by: Lin Ming <ming.m.lin@intel.com>
Thanks.
next prev parent reply other threads:[~2011-01-17 1:46 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
2011-01-16 19:51 ` Jesper Juhl
2011-01-17 1:47 ` Lin Ming [this message]
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=1295228831.28388.84.camel@minggr.sh.intel.com \
--to=ming.m.lin@intel.com \
--cc=jj@chaosbits.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--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