From: roel kluin Date: Sat, 25 Jul 2009 07:41:12 +0000 (+0000) Subject: fealnx: Write outside array bounds X-Git-Tag: 2.1b_release~11521^2~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f83284fe209b1d143244bf462abf1b414eb7b62a;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git fealnx: Write outside array bounds phy_idx is checked to be < 4, but np->phys[] is 2 elements long Signed-off-by: Roel Kluin Signed-off-by: David S. Miller --- diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index 891be28..ee51557 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, 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) {