]> git.baikalelectronics.ru Git - uboot.git/commit
net: phy: possible NULL dereference in fixed_phy_create()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 11 Jul 2022 17:40:13 +0000 (19:40 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 8 Aug 2022 15:37:57 +0000 (11:37 -0400)
commitceadd9b3dc81bb678a5421250bb65202caabecc6
tree0a3b95ddd647b84b14923a3efcd0247f047b53d5
parent449b5b96ee46a2ccc2cd38884cc321eddaf8eed5
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: a62b976714fb ("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>
drivers/net/phy/phy.c