Skip to content

Commit

Permalink
ideapad: uninitialized data in ideapad_acpi_add()
Browse files Browse the repository at this point in the history
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: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Dan Carpenter authored and Matthew Garrett committed Jun 26, 2012
1 parent a1071a5 commit 57f9616
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/platform/x86/ideapad-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,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 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);
Expand All @@ -721,7 +721,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;
Expand Down

0 comments on commit 57f9616

Please sign in to comment.