Commit c14973f9 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Len Brown

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: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarMattia Dongili <malattia@linux.it>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 7a0b73a4
...@@ -1201,9 +1201,12 @@ static void sony_nc_rfkill_setup(struct acpi_device *device) ...@@ -1201,9 +1201,12 @@ static void sony_nc_rfkill_setup(struct acpi_device *device)
/* the buffer is filled with magic numbers describing the devices /* the buffer is filled with magic numbers describing the devices
* available, 0xff terminates the enumeration * available, 0xff terminates the enumeration
*/ */
while ((dev_code = *(device_enum->buffer.pointer + i)) != 0xff && for (i = 0; i < device_enum->buffer.length; i++) {
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); dprintk("Radio devices, looking at 0x%.2x\n", dev_code);
if (dev_code == 0 && !sony_rfkill_devices[SONY_WIFI]) if (dev_code == 0 && !sony_rfkill_devices[SONY_WIFI])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment