提交 c14973f9 编写于 作者: D Dmitry Torokhov 提交者: 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: NDmitry Torokhov <dtor@mail.ru>
Acked-by: NMattia Dongili <malattia@linux.it>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 7a0b73a4
......@@ -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])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册