Skip to content

Commit

Permalink
sony-laptop - fix using of uninitialized variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Len Brown committed Jan 16, 2010
1 parent 7a0b73a commit c14973f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit c14973f

Please sign in to comment.