s6gmac: Read buffer overflow
authorroel kluin <roel.kluin@gmail.com>
Sat, 1 Aug 2009 20:20:13 +0000 (20:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Aug 2009 19:20:40 +0000 (12:20 -0700)
commit54706d99051582993037be5a076aa543fd7f1c38
tree74462b9fc52835114b8e28b72829dabc1e92342e
parent1b994b5a1b3cb5395598a08ef3bb0ac118d75c1b
s6gmac: Read buffer overflow

Check whether index is within bounds before testing the element.
In the last iteration i is PHY_MAX_ADDR. the condition
`!(p = pd->mii.bus->phy_map[PHY_MAX_ADDR])' is undefined and may
evaluate to false, which leads to a dereference of this invalid
phy_map in the phy_connect() below.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/s6gmac.c