LKML Archive on
help / color / mirror / Atom feed
From: Andrew Lunn <>
To: Brandon Maier <>
Subject: Re: [PATCH 1/3] net: phy: Check phy_driver ready before accessing
Date: Thu, 7 Jun 2018 18:52:27 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Jun 07, 2018 at 10:53:46AM -0500, Brandon Maier wrote:
> Since a phy_device is added to the global mdio_bus list during
> phy_device_register(), but a phy_device's phy_driver doesn't get
> attached until phy_probe(). It's possible of_phy_find_device() in
> xgmiitorgmii will return a valid phy with a NULL phy_driver. Leading to
> a NULL pointer access during the memcpy().

I'm sure there are more issues like this in the code.  e.g. there is
no attempt made to hold a reference to the child phy. So it could be
unbound. priv->phy_drv->read_status(phydev) is then going to do bad

Reviewed-by: Andrew Lunn <>


  parent reply	other threads:[~2018-06-07 16:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 15:53 Brandon Maier
2018-06-07 15:53 ` [PATCH 2/3] net: phy: xgmiitorgmii: Use correct mdio bus Brandon Maier
2018-06-07 16:49   ` Andrew Lunn
2018-06-07 17:37     ` Brandon Maier
2018-06-07 15:53 ` [PATCH 3/3] net: phy: xgmiitorgmii: Check read_status results Brandon Maier
2018-06-07 16:43   ` Andrew Lunn
2018-06-07 16:52 ` Andrew Lunn [this message]
2018-06-07 17:34   ` [PATCH 1/3] net: phy: Check phy_driver ready before accessing Brandon Maier
2018-06-07 18:12     ` Andrew Lunn
2018-06-07 16:54 ` Andrew Lunn

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 1/3] net: phy: Check phy_driver ready before accessing' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).