]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ACPI: check parameter for NULL
authorNick Piggin <nickpiggin@yahoo.com.au>
Mon, 11 Oct 2004 01:26:06 +0000 (18:26 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 11 Oct 2004 01:26:06 +0000 (18:26 -0700)
ACPI still explodes on my old PII and stops it booting.

Anyway, it is oopsing in drivers/acpi/scan.c line 207 where element
(which is NULL) gets dereferenced.

The ACPI bios on this thing has always seemed to be pretty broken, but
this at least allows the 'power' button to continue to work (the only
reason why I want ACPI).

drivers/acpi/scan.c

index c6916462b3c0a58e7f99ce4e01862e0cf317cb9e..4e46eeddf19c4bec9312f736069c50bba65f5ff9 100644 (file)
@@ -204,6 +204,8 @@ acpi_bus_extract_wakeup_device_power_package (
                return AE_BAD_PARAMETER;
 
        element = &(package->package.elements[0]);
+       if (!element)
+               return AE_BAD_PARAMETER;
        if (element->type == ACPI_TYPE_PACKAGE) {
                if ((element->package.count < 2) ||
                        (element->package.elements[0].type != ACPI_TYPE_LOCAL_REFERENCE) ||