]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/processor_throttling.c
ACPI: Move dereference after NULL test
[mv-sheeva.git] / drivers / acpi / processor_throttling.c
index 4c6c14c1e30788d6b025aaaabd511350dc9b678e..1c5d7a8b2fdfc86f2b51e434625fdc497aa099e5 100644 (file)
@@ -1133,15 +1133,15 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
        int result = 0;
        struct acpi_processor_throttling *pthrottling;
 
+       if (!pr)
+               return -EINVAL;
+
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
                          pr->throttling.address,
                          pr->throttling.duty_offset,
                          pr->throttling.duty_width));
 
-       if (!pr)
-               return -EINVAL;
-
        /*
         * Evaluate _PTC, _TSS and _TPC
         * They must all be present or none of them can be used.