Skip to content

Commit

Permalink
phy: fixed-phy: properly validate phy in fixed_phy_update_state()
Browse files Browse the repository at this point in the history
Validate that the phy_device passed into fixed_phy_update_state() is a
fixed-phy device before walking the list of phys for a fixed phy at the
same address.

Signed-off-by: Russell King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Russell King authored and davem330 committed Sep 25, 2015
1 parent 04d53b2 commit d618bf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/fixed_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int fixed_phy_update_state(struct phy_device *phydev,
struct fixed_mdio_bus *fmb = &platform_fmb;
struct fixed_phy *fp;

if (!phydev || !phydev->bus)
if (!phydev || phydev->bus != fmb->mii_bus)
return -EINVAL;

list_for_each_entry(fp, &fmb->phys, node) {
Expand Down

0 comments on commit d618bf2

Please sign in to comment.