Skip to contentSkip to conversation

ACPI: check a return value correctly in acpi_power_get_context()

PATCH In review Li Zefan 2 participants 2 messages Apr 7, 2008 – Apr 8, 2008 ACPI

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

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.

---
 drivers/acpi/power.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/power.c +1 -1
index 76bf6d9..f2a76ac 100644
@@ -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
#1 lore raw
Quoted 13 lines · Li Zefan

We should check *resource != NULL rather than resource != NULL, which will be always true.

---
 drivers/acpi/power.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/power.c +0 -0
index 76bf6d9..f2a76ac 100644

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.