diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-07-25 03:41:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-26 21:50:37 -0400 |
commit | f83284fe209b1d143244bf462abf1b414eb7b62a (patch) | |
tree | 5a689ad615b25c388a7bea02e3fde805e18b11b2 /drivers/net/fealnx.c | |
parent | ffafa60d496f80c250f2ae0340ae94434c0b0b4d (diff) |
fealnx: Write outside array bounds
phy_idx is checked to be < 4, but np->phys[] is 2 elements long
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fealnx.c')
-rw-r--r-- | drivers/net/fealnx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index 891be28a7d4f..ee51557e942b 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c | |||
@@ -584,7 +584,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev, | |||
584 | if (np->flags == HAS_MII_XCVR) { | 584 | if (np->flags == HAS_MII_XCVR) { |
585 | int phy, phy_idx = 0; | 585 | int phy, phy_idx = 0; |
586 | 586 | ||
587 | for (phy = 1; phy < 32 && phy_idx < 4; phy++) { | 587 | for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys); |
588 | phy++) { | ||
588 | int mii_status = mdio_read(dev, phy, 1); | 589 | int mii_status = mdio_read(dev, phy, 1); |
589 | 590 | ||
590 | if (mii_status != 0xffff && mii_status != 0x0000) { | 591 | if (mii_status != 0xffff && mii_status != 0x0000) { |