From: Vasily Averin <vvs@sw.ru>
To: Len Brown <len.brown@intel.com>,
linux-acpi@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, Kirill Korotaev <dev@sw.ru>,
devel@openvz.org
Subject: [PATCH ACPI] memory leakages in drivers/acpi/thermal.c
Date: Sun, 09 Apr 2006 19:08:40 +0400 [thread overview]
Message-ID: <44392378.3090400@sw.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
acpi_thermal_write_trip_points() and acpi_thermal_add() do not call kfree() for
allocated memory on the error path.
Signed-off-by: Vasily Averin <vvs@sw.ru>
Thank you,
Vasily Averin
SWsoft Virtuozzo/OpenVZ Linux kernel team
[-- Attachment #2: diff-ms-acpi-thermal-20060409 --]
[-- Type: text/plain, Size: 720 bytes --]
--- a/drivers/acpi/thermal.c 2006-04-09 17:03:50.000000000 +0400
+++ b/drivers/acpi/thermal.c 2006-04-09 17:46:41.000000000 +0400
@@ -942,8 +942,10 @@ acpi_thermal_write_trip_points(struct fi
memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
- if (!active)
+ if (!active) {
+ kfree(limit_string);
return_VALUE(-ENOMEM);
+ }
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
@@ -1342,7 +1344,7 @@ static int acpi_thermal_add(struct acpi_
result = acpi_thermal_add_fs(device);
if (result)
- return_VALUE(result);
+ goto end;
init_timer(&tz->timer);
reply other threads:[~2006-04-09 15:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=44392378.3090400@sw.ru \
--to=vvs@sw.ru \
--cc=akpm@osdl.org \
--cc=dev@sw.ru \
--cc=devel@openvz.org \
--cc=len.brown@intel.com \
--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