From: Li Zefan <lizf@cn.fujitsu.com>
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] ACPI: check a return value correctly in acpi_power_get_context()
Date: Mon, 07 Apr 2008 16:57:06 +0800 [thread overview]
Message-ID: <47F9E1E2.5020506@cn.fujitsu.com> (raw)
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
next reply other threads:[~2008-04-07 8:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 8:57 Li Zefan [this message]
2008-04-08 8:38 ` [PATCH] ACPI: check a return value correctly in acpi_power_get_context() Zhao Yakui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47F9E1E2.5020506@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox