drivers/platform/x86: Eliminate a NULL pointer dereference
[deliverable/linux.git] / drivers / platform / x86 / sony-laptop.c
index 1387c5f9c24d926aef958528cc031a5478475e1f..a47fd4eef8a30907fe3a5909d67ecd59b248dee2 100644 (file)
@@ -1196,9 +1196,13 @@ static void sony_nc_rfkill_setup(struct acpi_device *device)
        }
 
        device_enum = (union acpi_object *) buffer.pointer;
-       if (!device_enum || device_enum->type != ACPI_TYPE_BUFFER) {
-               printk(KERN_ERR "Invalid SN06 return object 0x%.2x\n",
-                               device_enum->type);
+       if (!device_enum) {
+               pr_err("Invalid SN06 return object\n");
+               goto out_no_enum;
+       }
+       if (device_enum->type != ACPI_TYPE_BUFFER) {
+               pr_err("Invalid SN06 return object type 0x%.2x\n",
+                      device_enum->type);
                goto out_no_enum;
        }
 
This page took 0.024728 seconds and 5 git commands to generate.