forcedeth: fix buffer overflow
authordavid decotigny <decot@googlers.com>
Fri, 24 Aug 2012 17:22:51 +0000 (17:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Aug 2012 17:04:27 +0000 (13:04 -0400)
Found by manual code inspection.

Tested: compile, reboot, ethtool -d ethX

Signed-off-by: David Decotigny <decot@googlers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/nvidia/forcedeth.c

index f45def0..51d19d8 100644 (file)
@@ -4435,7 +4435,7 @@ static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void
 
        regs->version = FORCEDETH_REGS_VER;
        spin_lock_irq(&np->lock);
-       for (i = 0; i <= np->register_size/sizeof(u32); i++)
+       for (i = 0; i < np->register_size/sizeof(u32); i++)
                rbuf[i] = readl(base + i*sizeof(u32));
        spin_unlock_irq(&np->lock);
 }