Commit f9f833a2 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by sanglipeng
Browse files

net: stmmac: fix invalid call to mdiobus_get_phy()

stable inclusion
from stable-v5.10.166
commit 34f11949938b90f29886579fa3450a0df1ba3a5b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I87FRA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=34f11949938b90f29886579fa3450a0df1ba3a5b



--------------------------------

[ Upstream commit 1f3bd64a ]

In a number of cases the driver assigns a default value of -1 to
priv->plat->phy_addr. This may result in calling mdiobus_get_phy()
with addr parameter being -1. Therefore check for this scenario and
bail out before calling mdiobus_get_phy().

Fixes: 42e87024 ("net: stmmac: Fix case when PHY handle is not present")
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/669f9671-ecd1-a41b-2727-7b73e3003985@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 9c92053b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment