[PATCH] drivers/net/wireless/ipw2200.c: fix an array overun
authorAdrian Bunk <bunk@stusta.de>
Sat, 11 Mar 2006 03:42:58 +0000 (04:42 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 17 Mar 2006 20:41:20 +0000 (15:41 -0500)
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>
drivers/net/wireless/ipw2200.c

index 65c5b1422ec9dad96fe9c88929bd21a249969917..93d53f9dab0e8fad7cff33d7687043a9c5b3cbc4 100644 (file)
@@ -9972,9 +9972,8 @@ static int ipw_ethtool_set_eeprom(struct net_device *dev,
                return -EINVAL;
        mutex_lock(&p->mutex);
        memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len);
-       for (i = IPW_EEPROM_DATA;
-            i < IPW_EEPROM_DATA + IPW_EEPROM_IMAGE_SIZE; i++)
-               ipw_write8(p, i, p->eeprom[i]);
+       for (i = 0; i < IPW_EEPROM_IMAGE_SIZE; i++)
+               ipw_write8(p, i + IPW_EEPROM_DATA, p->eeprom[i]);
        mutex_unlock(&p->mutex);
        return 0;
 }