ACPI: check a return value correctly in acpi_power_get_context()
authorLi Zefan <lizf@cn.fujitsu.com>
Fri, 18 Apr 2008 20:27:29 +0000 (13:27 -0700)
committerLen Brown <len.brown@intel.com>
Tue, 29 Apr 2008 14:10:03 +0000 (10:10 -0400)
We should check *resource != NULL rather than resource != NULL, which will be
always true.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/power.c

index 76bf6d90c700efac7905d6167680915ca50e1498..f2a76acecfcd45383432adbfd41c52775e12a3f2 100644 (file)
@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handle,
        }
 
        *resource = acpi_driver_data(device);
-       if (!resource)
+       if (!*resource)
                return -ENODEV;
 
        return 0;