netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: octeon-ethernet: trivial: Avoid OOPS if phydev is not set
@ 2013-10-13 18:59 Sebastian Pöhn
  2013-10-13 21:28 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Pöhn @ 2013-10-13 18:59 UTC (permalink / raw)
  To: driverdev-devel; +Cc: support, netdev

A zero pointer deref on priv->phydev->link was causing oops on our systems.
Might be related to improper configuration but we should fail gracefully here ;-)

Signed-off-by: Sebastian Poehn <sebastian.poehn@googlemail.com>

---

diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 83b1030..bc8c503 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -121,6 +121,9 @@ static void cvm_oct_adjust_link(struct net_device *dev)
        struct octeon_ethernet *priv = netdev_priv(dev);
        cvmx_helper_link_info_t link_info;
 
+       if(!priv->phydev)
+               return ;
+
        if (priv->last_link != priv->phydev->link) {
                priv->last_link = priv->phydev->link;
                link_info.u64 = 0;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-15  9:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-13 18:59 [PATCH] staging: octeon-ethernet: trivial: Avoid OOPS if phydev is not set Sebastian Pöhn
2013-10-13 21:28 ` Greg KH
2013-10-14 10:10   ` Dan Carpenter
2013-10-14 18:39     ` Aaro Koskinen
2013-10-14 19:16       ` Dan Carpenter
2013-10-14 19:49         ` Aaro Koskinen
2013-10-15  9:47           ` Dan Carpenter

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