bbswitch: Check for result before deref it

common-wmi
Lekensteyn 13 years ago
parent 398c8d2a7b
commit 6af35bd55b

@ -63,7 +63,9 @@ static int acpi_optimus_dsm(acpi_handle handle, int func, char *args,
obj = (union acpi_object *)output.pointer; obj = (union acpi_object *)output.pointer;
if (obj->type == ACPI_TYPE_INTEGER) if (obj->type == ACPI_TYPE_INTEGER)
if (result)
*result = obj->integer.value; *result = obj->integer.value;
// REVS (revision number) not found, possibly not an Optimus? // REVS (revision number) not found, possibly not an Optimus?
if (obj->integer.value == 0x80000002) { if (obj->integer.value == 0x80000002) {
printk(KERN_INFO "bbswitch: Optimus function not found\n"); printk(KERN_INFO "bbswitch: Optimus function not found\n");

Loading…
Cancel
Save