Skip to contentSkip to conversation

acpi: check a return value correctly in acpi_power_get_context()

PATCH Applied [email protected] 2 participants 2 messages Apr 18, 2008 – Apr 29, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

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.

---

 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
diff -puN drivers/acpi/power.c~acpi-check-a-return-value-correctly-in-acpi_power_get_context drivers/acpi/power.c
@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handl
 	}
 
 	*resource = acpi_driver_data(device);
-	if (!resource)
+	if (!*resource)
 		return -ENODEV;
 
 	return 0;

_

reviewer Applied
#1 lore raw

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.

---

 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_context drivers/acpi/power.c

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;

_
--
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