netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mail@maciej.szmigiero.name
Cc: netdev@vger.kernel.org, B38611@freescale.com,
	Frank.Li@freescale.com, LW@KARO-electronics.de,
	fabio.estevam@freescale.com, andrew@lunn.ch,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: fec: normalize return value of pm_runtime_get_sync() in MDIO write
Date: Sat, 05 Sep 2015 22:04:25 -0700 (PDT)	[thread overview]
Message-ID: <20150905.220425.2069850242655969926.davem@davemloft.net> (raw)
In-Reply-To: <55E8A1B6.2080008@maciej.szmigiero.name>

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.

      parent reply	other threads:[~2015-09-06  5:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 19:38 [PATCH] net: fec: normalize return value of pm_runtime_get_sync() in MDIO write Maciej S. Szmigiero
2015-09-03 19:49 ` Andrew Lunn
2015-09-06  5:04 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150905.220425.2069850242655969926.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=B38611@freescale.com \
    --cc=Frank.Li@freescale.com \
    --cc=LW@KARO-electronics.de \
    --cc=andrew@lunn.ch \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@maciej.szmigiero.name \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).