public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* acpi thermal driver leaks in failure path
@ 2006-03-09  3:12 Dave Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2006-03-09  3:12 UTC (permalink / raw)
  To: Linux Kernel; +Cc: len.brown

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
* RE: acpi thermal driver leaks in failure path
@ 2006-03-11  3:32 Brown, Len
  0 siblings, 0 replies; 2+ messages in thread
From: Brown, Len @ 2006-03-11  3:32 UTC (permalink / raw)
  To: Dave Jones, Linux Kernel

applied.

thanks,
-Len 

>-----Original Message-----
>From: Dave Jones [mailto:davej@redhat.com] 
>Sent: Wednesday, March 08, 2006 10:12 PM
>To: Linux Kernel
>Cc: Brown, Len
>Subject: acpi thermal driver leaks in failure path
>
>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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-11  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-09  3:12 acpi thermal driver leaks in failure path Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2006-03-11  3:32 Brown, Len

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox