Skip to content

Commit c2f9a4e

Browse files
Colin Ian KingKalle Valo
authored andcommitted
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: be663ab ("iwlwifi: split the drivers for agn and legacy devices 3945/4965") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent f76c340 commit c2f9a4e

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/intel/iwlegacy

1 file changed

+1
-1
lines changed

drivers/net/wireless/intel/iwlegacy/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ il_eeprom_init(struct il_priv *il)
699699
u32 gp = _il_rd(il, CSR_EEPROM_GP);
700700
int sz;
701701
int ret;
702-
u16 addr;
702+
int addr;
703703

704704
/* allocate eeprom */
705705
sz = il->cfg->eeprom_size;

0 commit comments

Comments
 (0)