diff options
author | Dmitry Torokhov | 2010-01-10 09:15:44 +0100 |
---|---|---|
committer | Len Brown | 2010-01-16 21:55:43 +0100 |
commit | c14973f93027500301fc40333e16ae49e58923a7 (patch) | |
tree | 3871ff0541b63a80940516fd6cab2008de0420c9 /drivers/platform/x86/sony-laptop.c | |
parent | ACPI: Fix section mismatch error for acpi_early_processor_set_pdc() (diff) | |
download | kernel-qcow2-linux-c14973f93027500301fc40333e16ae49e58923a7.tar.gz kernel-qcow2-linux-c14973f93027500301fc40333e16ae49e58923a7.tar.xz kernel-qcow2-linux-c14973f93027500301fc40333e16ae49e58923a7.zip |
sony-laptop - fix using of uninitialized variable
CC [M] drivers/platform/x86/sony-laptop.o
drivers/platform/x86/sony-laptop.c: In function 'sony_nc_rfkill_setup':
drivers/platform/x86/sony-laptop.c:1162: warning: 'i' may be used uninitialized in this function
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform/x86/sony-laptop.c')
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 5af53340da6f..3f71a605a492 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -1201,9 +1201,12 @@ static void sony_nc_rfkill_setup(struct acpi_device *device) /* the buffer is filled with magic numbers describing the devices * available, 0xff terminates the enumeration */ - while ((dev_code = *(device_enum->buffer.pointer + i)) != 0xff && - i < device_enum->buffer.length) { - i++; + for (i = 0; i < device_enum->buffer.length; i++) { + + dev_code = *(device_enum->buffer.pointer + i); + if (dev_code == 0xff) + break; + dprintk("Radio devices, looking at 0x%.2x\n", dev_code); if (dev_code == 0 && !sony_rfkill_devices[SONY_WIFI]) |