public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: len.brown@intel.com
Subject: acpi thermal driver leaks in failure path
Date: Wed, 8 Mar 2006 22:12:18 -0500	[thread overview]
Message-ID: <20060309031218.GA18238@redhat.com> (raw)

Leaking memory in failure path.

Coverity: #601
Signed-off-by: Dave Jones <davej@redhat.com>

--- linux-2.6/drivers/acpi/thermal.c~	2006-03-08 22:09:51.000000000 -0500
+++ linux-2.6/drivers/acpi/thermal.c	2006-03-08 22:11:05.000000000 -0500
@@ -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"));
-- 
http://www.codemonkey.org.uk

             reply	other threads:[~2006-03-09  3:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09  3:12 Dave Jones [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-11  3:32 acpi thermal driver leaks in failure path Brown, Len

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=20060309031218.GA18238@redhat.com \
    --to=davej@redhat.com \
    --cc=len.brown@intel.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