[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150903194929.GB19471@lunn.ch>
Date: Thu, 3 Sep 2015 21:49:29 +0200
From: Andrew Lunn <andrew@...n.ch>
To: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Nimrod Andy <B38611@...escale.com>,
Frank Li <Frank.Li@...escale.com>,
"Lothar Waßmann" <LW@...O-electronics.de>,
Fabio Estevam <fabio.estevam@...escale.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: fec: normalize return value of
pm_runtime_get_sync() in MDIO write
On Thu, Sep 03, 2015 at 09:38:30PM +0200, Maciej S. Szmigiero wrote:
> 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@...iej.szmigiero.name>
Fixes: 8fff755e9f8d ("net: fec: Ensure clocks are enabled while using mdio bus")
Acked-by: Andrew Lunn <andrew@...n.ch>
Thanks
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists