]> err.no Git - linux-2.6/commitdiff
[ACPI] drivers/acpi/video.c: fix error path NULL pointer dereference
authorAdrian Bunk <bunk@stusta.de>
Sat, 11 Mar 2006 15:12:00 +0000 (10:12 -0500)
committerLen Brown <len.brown@intel.com>
Fri, 31 Mar 2006 06:02:39 +0000 (01:02 -0500)
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>
drivers/acpi/video.c

index bd4887518373e2a2111cf9f2af755519d749361d..724149d72d91adcd2d88293d2f5854b76f259791 100644 (file)
@@ -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;