public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/acpi/video.c: fix a NULL pointer dereference
@ 2006-03-10 17:09 Adrian Bunk
  0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2006-03-10 17:09 UTC (permalink / raw)
  To: len.brown; +Cc: linux-acpi, linux-kernel

The Coverity checker spotted this obvious bug in 
acpi_video_device_lcd_query_levels().



Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c.old	2006-03-10 18:04:18.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c	2006-03-10 18:04:33.000000000 +0100
@@ -321,11 +321,11 @@ acpi_video_device_lcd_query_levels(struc
 
 	status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer);
 	if (!ACPI_SUCCESS(status))
 		return_VALUE(status);
 	obj = (union acpi_object *)buffer.pointer;
-	if (!obj && (obj->type != ACPI_TYPE_PACKAGE)) {
+	if (obj && (obj->type != ACPI_TYPE_PACKAGE)) {
 		ACPI_ERROR((AE_INFO, "Invalid _BCL data"));
 		status = -EFAULT;
 		goto err;
 	}
 


^ permalink raw reply	[flat|nested] 4+ messages in thread
* RE: [2.6 patch] drivers/acpi/video.c: fix a NULL pointer dereference
@ 2006-03-11  4:00 Brown, Len
  2006-03-11 15:11 ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Brown, Len @ 2006-03-11  4:00 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-acpi, linux-kernel


>The Coverity checker spotted this obvious bug in 
>acpi_video_device_lcd_query_levels().
>
>
>
>Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
>--- linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c.old	
>2006-03-10 18:04:18.000000000 +0100
>+++ linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c	
>2006-03-10 18:04:33.000000000 +0100
>@@ -321,11 +321,11 @@ acpi_video_device_lcd_query_levels(struc
> 
> 	status = acpi_evaluate_object(device->handle, "_BCL", 
>NULL, &buffer);
> 	if (!ACPI_SUCCESS(status))
> 		return_VALUE(status);
> 	obj = (union acpi_object *)buffer.pointer;
>-	if (!obj && (obj->type != ACPI_TYPE_PACKAGE)) {
>+	if (obj && (obj->type != ACPI_TYPE_PACKAGE)) {

how about
+	if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {

> 		ACPI_ERROR((AE_INFO, "Invalid _BCL data"));
> 		status = -EFAULT;
> 		goto err;
> 	}
> 
>

^ permalink raw reply	[flat|nested] 4+ messages in thread
* RE: [2.6 patch] drivers/acpi/video.c: fix a NULL pointer dereference
@ 2006-03-13  3:33 Brown, Len
  0 siblings, 0 replies; 4+ messages in thread
From: Brown, Len @ 2006-03-13  3:33 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-acpi, linux-kernel

applied,
thanks,
-len


>-	if (!obj && (obj->type != ACPI_TYPE_PACKAGE)) {
>+	if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-10 17:09 [2.6 patch] drivers/acpi/video.c: fix a NULL pointer dereference Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2006-03-11  4:00 Brown, Len
2006-03-11 15:11 ` Adrian Bunk
2006-03-13  3:33 Brown, Len

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