acpi: check a return value correctly in acpi_power_get_context()
PATCH 8/9 acpi: check a return value correctly in acpi_power_get_context()
From: Li Zefan <[email protected]>
We should check *resource != NULL rather than resource != NULL, which will be always true.
Signed-off-by Li Zefan <[email protected]>
Acked-by Zhao Yakui <[email protected]>
Cc Len Brown <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/acpi/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/power.c renamed from drivers/acpi/power.c~acpi-check-a-return-value-correctly-in-acpi_power_get_context +1 -1
@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handl } *resource =acpi_driver_data (device); -if (!resource) +if (!*resource)return -ENODEV ;return 0 ;
_
applied.
thanks,
-len
Quoted 32 lines · On Friday 18 April 2008, [email protected] wrote:
From: Li Zefan <[email protected]>
We should check *resource != NULL rather than resource != NULL, which will be always true.
Signed-off-by Li Zefan <[email protected]>Acked-by Zhao Yakui <[email protected]>Cc Len Brown <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/acpi/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -puN
drivers/acpi/power.c~acpi-check-a-return-value-correctly-in-acpi_power_get_contextdrivers/acpi/power.cdrivers/acpi/power.c renamed from drivers/acpi/power.c~acpi-check-a-return-value-correctly-in-acpi_power_get_context +1
-1@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handl } *resource =acpi_driver_data (device); -if (!resource) +if (!*resource)return -ENODEV ;return 0 ;_
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html