* [PATCH] ACPI: check a return value correctly in acpi_power_get_context()
@ 2008-04-07 8:57 Li Zefan
2008-04-08 8:38 ` Zhao Yakui
0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2008-04-07 8:57 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi, LKML
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: check a return value correctly in acpi_power_get_context()
2008-04-07 8:57 [PATCH] ACPI: check a return value correctly in acpi_power_get_context() Li Zefan
@ 2008-04-08 8:38 ` Zhao Yakui
0 siblings, 0 replies; 2+ messages in thread
From: Zhao Yakui @ 2008-04-08 8:38 UTC (permalink / raw)
To: Li Zefan; +Cc: lenb, linux-acpi, LKML
On Mon, 2008-04-07 at 16:57 +0800, Li Zefan wrote:
> 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;
agreed.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-08 0:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 8:57 [PATCH] ACPI: check a return value correctly in acpi_power_get_context() Li Zefan
2008-04-08 8:38 ` Zhao Yakui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox