]> git.baikalelectronics.ru Git - kernel.git/commit
iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop
authorColin Ian King <colin.king@canonical.com>
Sun, 26 Jan 2020 00:09:54 +0000 (00:09 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 26 Jan 2020 15:51:47 +0000 (17:51 +0200)
commit2694ff30250aac69f3cd36265d6c36e7ae692a7e
tree00e37d8a1b950179b4e12c4eb37c0630f96b4415
parentb327d0bb959751607f45792b76a1f0f7b1ab07db
iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop

The loop counter addr is a u16 where as the upper limit of the loop
is an int. In the unlikely event that the il->cfg->eeprom_size is
greater than 64K then we end up with an infinite loop since addr will
wrap around an never reach upper loop limit. Fix this by making addr
an int.

Addresses-Coverity: ("Infinite loop")
Fixes: 92be5c71117b ("iwlwifi: split the drivers for agn and legacy devices 3945/4965")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlegacy/common.c