From: Ike Panhc <ike.pan@canonical.com>
To: Matthew Garrett <mjg@redhat.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Maxim Mikityanskiy <maxtram95@gmail.com>,
Rob Landley <rob@landley.net>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: [PATCH 1/4] ideapad: uninitialized data in ideapad_acpi_add()
Date: Fri, 6 Jul 2012 16:07:39 +0800 [thread overview]
Message-ID: <1341562059-6985-1-git-send-email-ike.pan@canonical.com> (raw)
In-Reply-To: <1341562023-6951-1-git-send-email-ike.pan@canonical.com>
From: Dan Carpenter <dan.carpenter@oracle.com>
We only initialize the high bits of "cfg". It probably doesn't cause
a problem given that this is platform specific code and doesn't have to
worry about endianness etc. But it's sort of messy.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
---
drivers/platform/x86/ideapad-laptop.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 4f20f8d..5fdd1aa 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -693,11 +693,10 @@ MODULE_DEVICE_TABLE(acpi, ideapad_device_ids);
static int __devinit ideapad_acpi_add(struct acpi_device *adevice)
{
- int ret, i;
- unsigned long cfg;
+ int ret, i, cfg;
struct ideapad_private *priv;
- if (read_method_int(adevice->handle, "_CFG", (int *)&cfg))
+ if (read_method_int(adevice->handle, "_CFG", &cfg))
return -ENODEV;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
@@ -721,7 +720,7 @@ static int __devinit ideapad_acpi_add(struct acpi_device *adevice)
goto input_failed;
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) {
- if (test_bit(ideapad_rfk_data[i].cfgbit, &cfg))
+ if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
ideapad_register_rfkill(adevice, i);
else
priv->rfk[i] = NULL;
--
1.7.9.5
next prev parent reply other threads:[~2012-07-06 8:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4FF45C98.60305@gmail.com>
2012-07-06 8:07 ` [PATCH 0/4] ideapad: patches for v3.6 merge window Ike Panhc
2012-07-06 8:07 ` Ike Panhc [this message]
2012-07-06 8:07 ` [PATCH 2/4] ideapad: add Lenovo IdeaPad Z570 support (part 1) Ike Panhc
2012-07-06 8:08 ` [PATCH 3/4] ideapad: add Lenovo IdeaPad Z570 support (part 2) Ike Panhc
2012-07-06 8:08 ` [PATCH 4/4] ideapad: add Lenovo IdeaPad Z570 support (part 3) Ike Panhc
2012-07-28 4:08 ` [PATCH 0/4] ideapad: patches for v3.6 merge window Matthew Garrett
2012-07-30 1:39 ` Ike Panhc
2012-08-03 12:01 ` Максим Микитянский
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=1341562059-6985-1-git-send-email-ike.pan@canonical.com \
--to=ike.pan@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxtram95@gmail.com \
--cc=mjg@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rob@landley.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
all inboxes | Powered by JetHome®