diff options
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 32267d538b17..49fa1e4413fa 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -4800,11 +4800,7 @@ bnx2_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
4800 | struct bnx2 *bp = dev->priv; | 4800 | struct bnx2 *bp = dev->priv; |
4801 | int rc; | 4801 | int rc; |
4802 | 4802 | ||
4803 | if (eeprom->offset > bp->flash_info->total_size) | 4803 | /* parameters already validated in ethtool_get_eeprom */ |
4804 | return -EINVAL; | ||
4805 | |||
4806 | if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size) | ||
4807 | eeprom->len = bp->flash_info->total_size - eeprom->offset; | ||
4808 | 4804 | ||
4809 | rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len); | 4805 | rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len); |
4810 | 4806 | ||
@@ -4818,11 +4814,7 @@ bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
4818 | struct bnx2 *bp = dev->priv; | 4814 | struct bnx2 *bp = dev->priv; |
4819 | int rc; | 4815 | int rc; |
4820 | 4816 | ||
4821 | if (eeprom->offset > bp->flash_info->total_size) | 4817 | /* parameters already validated in ethtool_set_eeprom */ |
4822 | return -EINVAL; | ||
4823 | |||
4824 | if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size) | ||
4825 | eeprom->len = bp->flash_info->total_size - eeprom->offset; | ||
4826 | 4818 | ||
4827 | rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len); | 4819 | rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len); |
4828 | 4820 | ||