Skip to contentSkip to conversation

drivers/acpi/video.c: fix a NULL pointer dereference

PATCH New Adrian Bunk 1 participant 1 message Mar 10, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/acpi/video.c: fix a NULL pointer dereference

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

drivers/acpi/video.c renamed from drivers/acpi/video.c.old +1 -1
@@ -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;
 	}