From: Li Zefan Date: Fri, 18 Apr 2008 20:27:29 +0000 (-0700) Subject: ACPI: check a return value correctly in acpi_power_get_context() X-Git-Tag: v2.6.26-rc1~101^2~1^8~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a815ab8b5891f3d2515316655729272f68269e3b;p=linux-2.6 ACPI: check a return value correctly in acpi_power_get_context() We should check *resource != NULL rather than resource != NULL, which will be always true. Signed-off-by: Li Zefan Acked-by: Zhao Yakui Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 76bf6d90c7..f2a76acecf 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handle, } *resource = acpi_driver_data(device); - if (!resource) + if (!*resource) return -ENODEV; return 0;