Commit c3a7e44b authored by Colin Ian King's avatar Colin Ian King Committed by Ben Hutchings
Browse files

iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop



commit c2f9a4e4 upstream.

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: be663ab6 ("iwlwifi: split the drivers for agn and legacy devices 3945/4965")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 7c4b6b13
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment