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

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
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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])