Skip to content

Commit

Permalink
ACPI: check a return value correctly in acpi_power_get_context()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Len Brown committed Apr 29, 2008
1 parent 2a241d7 commit a815ab8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handle,
}

*resource = acpi_driver_data(device);
if (!resource)
if (!*resource)
return -ENODEV;

return 0;
Expand Down

0 comments on commit a815ab8

Please sign in to comment.