From: Roel Kluin <roel.kluin@gmail.com>
To: lenb@kernel.org, linux-acpi@vger.kernel.org
Subject: ACPI: Missing test after ioremap()?
Date: Thu, 30 Jul 2009 18:19:00 +0200 [thread overview]
Message-ID: <4A71C7F4.9000304@gmail.com> (raw)
Isn't a test missing after the ioremap()?
and if so can we error out like this?
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 7167071..b1eeecc 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -496,6 +496,9 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
void __iomem *virt_addr;
virt_addr = ioremap(phys_addr, width);
+ if (virt_addr == NULL)
+ return AE_ERROR;
+
if (!value)
value = &dummy;
@@ -524,6 +527,8 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
void __iomem *virt_addr;
virt_addr = ioremap(phys_addr, width);
+ if (virt_addr == NULL)
+ return AE_ERROR;
switch (width) {
case 8:
reply other threads:[~2009-07-30 16:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4A71C7F4.9000304@gmail.com \
--to=roel.kluin@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.