mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
net: phy: possible NULL dereference in fixed_phy_create()
We check if phydev is NULL. Only but if it is non-NULL we set one component of phydev. But even if it is NULL we set another. We should not dereference NULL in either case. Fixes: e24b58f5ed4f ("net: phy: don't require PHY interface mode during PHY creation") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Marek Behún <kabel@kernel.org>
This commit is contained in:
parent
8a3b69d2f2
commit
ebb8ff61ad
@ -984,10 +984,10 @@ struct phy_device *fixed_phy_create(ofnode node)
|
||||
}
|
||||
|
||||
phydev = phy_device_create(NULL, 0, PHY_FIXED_ID, false);
|
||||
if (phydev)
|
||||
if (phydev) {
|
||||
phydev->node = subnode;
|
||||
|
||||
phydev->interface = ofnode_read_phy_mode(node);
|
||||
}
|
||||
|
||||
return phydev;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user