From: akpm@linux-foundation.org
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org,
lizf@cn.fujitsu.com, yakui.zhao@intel.com
Subject: [patch 8/9] acpi: check a return value correctly in acpi_power_get_context()
Date: Fri, 18 Apr 2008 13:27:29 -0700 [thread overview]
Message-ID: <200804182027.m3IKRTq7013561@imap1.linux-foundation.org> (raw)
From: Li Zefan <lizf@cn.fujitsu.com>
We should check *resource != NULL rather than resource != NULL, which will be
always true.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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
--- a/drivers/acpi/power.c~acpi-check-a-return-value-correctly-in-acpi_power_get_context
+++ a/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;
_
next reply other threads:[~2008-04-18 20:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-18 20:27 akpm [this message]
2008-04-29 8:14 ` [patch 8/9] acpi: check a return value correctly in acpi_power_get_context() Len Brown
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=200804182027.m3IKRTq7013561@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=yakui.zhao@intel.com \
/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