From: david decotigny Date: Fri, 24 Aug 2012 17:22:51 +0000 (+0000) Subject: forcedeth: fix buffer overflow X-Git-Tag: MMI-PSA29.97-13-9~15870^2~270 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ba9aa134287f6a59886ea91e0dadaa8477dec9c2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git forcedeth: fix buffer overflow Found by manual code inspection. Tested: compile, reboot, ethtool -d ethX Signed-off-by: David Decotigny Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index f45def01a98e..51d19d8cb47c 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -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); }