Just a trio of minor fixes for bnx2.  Individual patches to follow.

If more convenient, you can pull from the linville-bnx2 branch of
netdev-jwl as described below.

Thanks,

John

---

The following changes since commit 330d57fb98a916fa8e1363846540dd420e99499a:
  Al Viro:
        Fix sysctl unregistration oops (CVE-2005-2709)

are found in the git repository at:

  git://git.tuxdriver.com/git/netdev-jwl.git linville-bnx2

John W. Linville:
      bnx2: output driver name as prefix in error message
      bnx2: check return of dev_alloc_skb in bnx2_test_loopback
      bnx2: avoid possible overflows in bnx2_get_eeprom

 drivers/net/bnx2.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8f46427..5459e2e 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2707,7 +2707,7 @@ bnx2_init_nvram(struct bnx2 *bp)
 
        if (j == entry_count) {
                bp->flash_info = NULL;
-               printk(KERN_ALERT "Unknown flash/EEPROM type.\n");
+               printk(KERN_ALERT PFX "Unknown flash/EEPROM type.\n");
                rc = -ENODEV;
        }
 
@@ -3903,6 +3903,8 @@ bnx2_test_loopback(struct bnx2 *bp)
 
        pkt_size = 1514;
        skb = dev_alloc_skb(pkt_size);
+       if (!skb)
+               return -ENOMEM;
        packet = skb_put(skb, pkt_size);
        memcpy(packet, bp->mac_addr, 6);
        memset(packet + 6, 0x0, 8);
@@ -4801,7 +4803,7 @@ bnx2_get_eeprom(struct net_device *dev, 
        if (eeprom->offset > bp->flash_info->total_size)
                return -EINVAL;
 
-       if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
+       if (eeprom->offset > bp->flash_info->total_size - eeprom->len)
                eeprom->len = bp->flash_info->total_size - eeprom->offset;
 
        rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);
@@ -4819,7 +4821,7 @@ bnx2_set_eeprom(struct net_device *dev, 
        if (eeprom->offset > bp->flash_info->total_size)
                return -EINVAL;
 
-       if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
+       if (eeprom->offset > bp->flash_info->total_size - eeprom->len)
                eeprom->len = bp->flash_info->total_size - eeprom->offset;
 
        rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len);
--
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to