Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d618bf2b authored by Russell King's avatar Russell King Committed by David S. Miller
Browse files

phy: fixed-phy: properly validate phy in fixed_phy_update_state()



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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04d53b20
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {