ACPI: check a return value correctly in acpi_power_get_context()
PATCH 1/1 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 <[email protected]>
--- drivers/acpi/power.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/power.c +1 -1
@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handle, } *resource =acpi_driver_data (device); -if (!resource) +if (!*resource)return -ENODEV ;return 0 ;
Signature · 1 line
1.5.4.rc3
Quoted 13 lines · Li Zefan
We should check *resource != NULL rather than resource != NULL, which will be always true.
Signed-off-by Li Zefan <[email protected]>--- drivers/acpi/power.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/acpi/power.c +0
-0
drivers/acpi/power.c acpi_power_get_context(acpi_handle handle, · line 127
Quoted 8 lines
drivers/acpi/power.c +1
-1@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handle, } *resource =acpi_driver_data (device); -if (!resource) +if (!*resource)return -ENODEV ;return 0 ;
agreed.