diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2015-09-03 21:38:30 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-05 22:04:06 -0700 |
commit | 42ea4457aea7aaeddf0c0b06724f297608f5e9d2 (patch) | |
tree | 1561fc937aa12a06407b17336927990d3b98f145 /net/rds/connection.c | |
parent | 0890cf6cb6ab1af650025670b1a839671a9a3fcb (diff) | |
download | op-kernel-dev-42ea4457aea7aaeddf0c0b06724f297608f5e9d2.zip op-kernel-dev-42ea4457aea7aaeddf0c0b06724f297608f5e9d2.tar.gz |
net: fec: normalize return value of pm_runtime_get_sync() in MDIO write
If fec MDIO write method succeeds its return value comes from
call to pm_runtime_get_sync().
But pm_runtime_get_sync() can also return 1.
In case of Micrel KSZ9031 PHY this value will then
be returned along the call chain of phy_write() ->
ksz9031_extended_write() -> ksz9031_center_flp_timing() ->
ksz9031_config_init() -> phy_init_hw() -> phy_attach_direct() ->
phy_connect_direct().
Then phy_connect() will cast it into a pointer using ERR_PTR(),
which then fec_enet_mii_probe() will try to dereference
resulting in an oops.
Fix it by normalizing return value of pm_runtime_get_sync()
to be zero if positive in MDIO write method.
Fixes: 8fff755e9f8d ("net: fec: Ensure clocks are enabled while using mdio bus")
Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/connection.c')
0 files changed, 0 insertions, 0 deletions