[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d2abc657-5813-2d40-915f-f831d3a93d93@atmel.com>
Date: Fri, 7 Oct 2016 18:22:09 +0200
From: Nicolas Ferre <nicolas.ferre@...el.com>
To: Xander Huff <xander.huff@...com>
CC: <netdev@...r.kernel.org>, Nathan Sullivan <nathan.sullivan@...com>,
<linux-kernel@...r.kernel.org>, Brad Mouring <brad.mouring@...com>
Subject: Re: [PATCH] net: macb: NULL out phydev after removing mdio bus
Le 07/10/2016 à 17:13, Xander Huff a écrit :
> From: Nathan Sullivan <nathan.sullivan@...com>
>
> To ensure the dev->phydev pointer is not used after becoming invalid in
> mdiobus_unregister, set it to NULL. This happens when removing the macb
> driver without first taking its interface down, since unregister_netdev
> will end up calling macb_close.
>
> Signed-off-by: Xander Huff <xander.huff@...com>
> Signed-off-by: Nathan Sullivan <nathan.sullivan@...com>
> Signed-off-by: Brad Mouring <brad.mouring@...com>
Acked-by: Nicolas Ferre <nicolas.ferre@...el.com>
> ---
> drivers/net/ethernet/cadence/macb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 63144bb..b32444a 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -3117,6 +3117,7 @@ static int macb_remove(struct platform_device *pdev)
> if (dev->phydev)
> phy_disconnect(dev->phydev);
> mdiobus_unregister(bp->mii_bus);
> + dev->phydev = NULL;
> mdiobus_free(bp->mii_bus);
>
> /* Shutdown the PHY if there is a GPIO reset */
>
--
Nicolas Ferre
Powered by blists - more mailing lists