netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fealnx: Write outside array bounds
@ 2009-07-24 11:49 Roel Kluin
  2009-07-25  9:55 ` Ilpo Järvinen
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-07-24 11:49 UTC (permalink / raw)
  To: David S. Miller, netdev, Andrew Morton

phy_idx is checked to be < 4, but np->phys[] is 2 elements long

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Or should the number of elements be increased?

diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 48385c4..100badd 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -584,7 +584,7 @@ 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 < 2; phy++) {
 			int mii_status = mdio_read(dev, phy, 1);
 
 			if (mii_status != 0xffff && mii_status != 0x0000) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-27  2:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-24 11:49 [PATCH] fealnx: Write outside array bounds Roel Kluin
2009-07-25  9:55 ` Ilpo Järvinen
2009-07-25 17:41   ` Roel Kluin
2009-07-27  2:01     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).