Browse Source

[ACPI] drivers/acpi/video.c: fix error path NULL pointer dereference

The Coverity checker spotted this bug in
acpi_video_device_lcd_query_levels().

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Adrian Bunk 19 years ago
parent
commit
6665bda764
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/acpi/video.c

+ 1 - 1
drivers/acpi/video.c

@@ -323,7 +323,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
 	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_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n"));
 		status = -EFAULT;
 		goto err;