aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8f464271664d..49fa1e4413fa 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2707,7 +2707,7 @@ bnx2_init_nvram(struct bnx2 *bp)
2707 2707
2708 if (j == entry_count) { 2708 if (j == entry_count) {
2709 bp->flash_info = NULL; 2709 bp->flash_info = NULL;
2710 printk(KERN_ALERT "Unknown flash/EEPROM type.\n"); 2710 printk(KERN_ALERT PFX "Unknown flash/EEPROM type.\n");
2711 rc = -ENODEV; 2711 rc = -ENODEV;
2712 } 2712 }
2713 2713
@@ -3903,6 +3903,8 @@ bnx2_test_loopback(struct bnx2 *bp)
3903 3903
3904 pkt_size = 1514; 3904 pkt_size = 1514;
3905 skb = dev_alloc_skb(pkt_size); 3905 skb = dev_alloc_skb(pkt_size);
3906 if (!skb)
3907 return -ENOMEM;
3906 packet = skb_put(skb, pkt_size); 3908 packet = skb_put(skb, pkt_size);
3907 memcpy(packet, bp->mac_addr, 6); 3909 memcpy(packet, bp->mac_addr, 6);
3908 memset(packet + 6, 0x0, 8); 3910 memset(packet + 6, 0x0, 8);
@@ -4798,11 +4800,7 @@ bnx2_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
4798 struct bnx2 *bp = dev->priv; 4800 struct bnx2 *bp = dev->priv;
4799 int rc; 4801 int rc;
4800 4802
4801 if (eeprom->offset > bp->flash_info->total_size) 4803 /* parameters already validated in ethtool_get_eeprom */
4802 return -EINVAL;
4803
4804 if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
4805 eeprom->len = bp->flash_info->total_size - eeprom->offset;
4806 4804
4807 rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len); 4805 rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);
4808 4806
@@ -4816,11 +4814,7 @@ bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
4816 struct bnx2 *bp = dev->priv; 4814 struct bnx2 *bp = dev->priv;
4817 int rc; 4815 int rc;
4818 4816
4819 if (eeprom->offset > bp->flash_info->total_size) 4817 /* parameters already validated in ethtool_set_eeprom */
4820 return -EINVAL;
4821
4822 if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
4823 eeprom->len = bp->flash_info->total_size - eeprom->offset;
4824 4818
4825 rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len); 4819 rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len);
4826 4820