projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ffafa60
)
fealnx: Write outside array bounds
author
roel kluin
<roel.kluin@gmail.com>
Sat, 25 Jul 2009 07:41:12 +0000
(07:41 +0000)
committer
David S. Miller
<davem@davemloft.net>
Mon, 27 Jul 2009 01:50:37 +0000
(18:50 -0700)
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>
drivers/net/fealnx.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/fealnx.c
b/drivers/net/fealnx.c
index 891be28a7d4f43625ad5072c77b372e854564a01..ee51557e942b30d37debea42281e6f479c21b9f3 100644
(file)
--- 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) {