public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH] acpi/osl: clear high bits in acpi_os_read_memory value
Date: Mon, 7 Jul 2014 15:38:53 -0400	[thread overview]
Message-ID: <1404761933-27300-1-git-send-email-paul.gortmaker@windriver.com> (raw)

If one looks at acpi_os_read_port() it is very similar to the
acpi_os_read_memory() aside from the underlying I/O method.
However we zero out the u32 in the former and not in the latter,
when it seems prudent to do so in both.

This was found by quasi-random code inspection, and as such there
is no known symptom or bug to associate with possibly having stale
data in the high bits of "value".

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/acpi/osl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index bad25b070fe0..a7373f1f31c8 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -953,6 +953,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u64 *value, u32 width)
 	if (!value)
 		value = &dummy;
 
+	*value = 0;
 	switch (width) {
 	case 8:
 		*(u8 *) value = readb(virt_addr);
-- 
1.9.2


             reply	other threads:[~2014-07-07 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 19:38 Paul Gortmaker [this message]
2014-07-07 20:15 ` [PATCH] acpi/osl: clear high bits in acpi_os_read_memory value Rafael J. Wysocki

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=1404761933-27300-1-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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