Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753882AbbDPQ4O (ORCPT ); Thu, 16 Apr 2015 12:56:14 -0400 Received: from outbound-smtp05.blacknight.com ([81.17.249.38]:47843 "EHLO outbound-smtp05.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753584AbbDPQ4F (ORCPT ); Thu, 16 Apr 2015 12:56:05 -0400 From: "Bryan O'Donoghue" To: peppe.cavallaro@st.com, netdev@vger.kernel.org, davem@davemloft.net Cc: andriy.shevchenko@linux.intel.com, hock.leong.kweh@intel.com, boon.leong.ong@intel.com, dan.odonovan@emutex.com, linux-kernel@vger.kernel.org, "Bryan O'Donoghue" Subject: [PATCH v3 1/1] stmmac: fix oops on rmmod after assigning ip addr Date: Thu, 16 Apr 2015 17:56:03 +0100 Message-Id: <1429203363-10919-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429203363-10919-1-git-send-email-pure.logic@nexus-software.ie> References: <1429203363-10919-1-git-send-email-pure.logic@nexus-software.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1728 Lines: 48 An oops exists in the flow of stmmac_release(). phy_ethtool_get_wol() depends on phydev->drv. phydev->drv will be null after stmmac_mdio_unreg() completes. Steps to reproduce on Quark X1000: 1. ifconfig eth0 192.168.0.1 2. rmmod stmmac_pci To fix this stmmac_mdio_unreg() should be run after unregister_netdev(). Signed-off-by: Bryan O'Donoghue Reported-by: Dan O'Donovan --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 06103ca..6065173 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2970,15 +2970,15 @@ int stmmac_dvr_remove(struct net_device *ndev) priv->hw->dma->stop_tx(priv->ioaddr); stmmac_set_mac(priv->ioaddr, false); - if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI && - priv->pcs != STMMAC_PCS_RTBI) - stmmac_mdio_unregister(ndev); netif_carrier_off(ndev); unregister_netdev(ndev); if (priv->stmmac_rst) reset_control_assert(priv->stmmac_rst); clk_disable_unprepare(priv->pclk); clk_disable_unprepare(priv->stmmac_clk); + if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI && + priv->pcs != STMMAC_PCS_RTBI) + stmmac_mdio_unregister(ndev); free_netdev(ndev); return 0; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/