Skip to content

Commit

Permalink
fealnx: Write outside array bounds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roel kluin authored and David S. Miller committed Jul 27, 2009
1 parent ffafa60 commit f83284f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/fealnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
if (np->flags == HAS_MII_XCVR) {
int phy, phy_idx = 0;

for (phy = 1; phy < 32 && phy_idx < 4; phy++) {
for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys);
phy++) {
int mii_status = mdio_read(dev, phy, 1);

if (mii_status != 0xffff && mii_status != 0x0000) {
Expand Down

0 comments on commit f83284f

Please sign in to comment.