lkml.org 
[lkml]   [2008]   [Apr]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateMon, 07 Apr 2008 16:57:06 +0800
FromLi Zefan <>
Subject[PATCH] 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 <lizf@cn.fujitsu.com>
---
 drivers/acpi/power.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 76bf6d9..f2a76ac 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -121,7 +121,7 @@ acpi_power_get_context(acpi_handle handle,
 	}
 
 	*resource = acpi_driver_data(device);
-	if (!resource)
+	if (!*resource)
 		return -ENODEV;
 
 	return 0;
-- 
1.5.4.rc3


\
 
 \ /
  Last update: 2008-04-07 11:01    [from the cache]
©2003-2008