lkml.org 
[lkml]   [2015]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: fec: normalize return value of pm_runtime_get_sync() in MDIO write
From
From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Date: Thu, 03 Sep 2015 21:38:30 +0200

> 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.
>
> Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>

Applied.


\
 
 \ /
  Last update: 2015-09-06 07:41    [W:0.043 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site