Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] drivers/net/wireless/ipw2200.c: fix an array overun

This patch fixes a big array overun found by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Adrian Bunk and committed by
John W. Linville
71e585fc f44349f2

+2 -3
+2 -3
drivers/net/wireless/ipw2200.c
··· 9972 9972 return -EINVAL; 9973 9973 mutex_lock(&p->mutex); 9974 9974 memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len); 9975 - for (i = IPW_EEPROM_DATA; 9976 - i < IPW_EEPROM_DATA + IPW_EEPROM_IMAGE_SIZE; i++) 9977 - ipw_write8(p, i, p->eeprom[i]); 9975 + for (i = 0; i < IPW_EEPROM_IMAGE_SIZE; i++) 9976 + ipw_write8(p, i + IPW_EEPROM_DATA, p->eeprom[i]); 9978 9977 mutex_unlock(&p->mutex); 9979 9978 return 0; 9980 9979 }