[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <563227EB.10708@baylibre.com>
Date: Thu, 29 Oct 2015 15:06:35 +0100
From: Neil Armstrong <narmstrong@...libre.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: "David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
vivien.didelot@...oirfairelinux.com,
Fabian Frederick <fabf@...net.be>,
Pavel Nakonechny <pavel.nakonechny@...tlab.ru>,
Joe Perches <joe@...ches.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Frode Isaksen <fisaksen@...libre.com>
Subject: Re: [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy
On 10/29/2015 03:00 PM, Andrew Lunn wrote:
> On Thu, Oct 29, 2015 at 02:23:25PM +0100, Neil Armstrong wrote:
>>
>> + netif_carrier_off(ds->ports[port]);
>> unregister_netdev(ds->ports[port]);
>> + phy_disconnect(p->phy);
>> free_netdev(ds->ports[port]);
>> }
>
> Once you make it actually compile....
>
> I'm not sure this is safe. The loop above this one has just destroyed
> some phys, and now you are potentially disconnecting a phy you just
> destroyed, causing it to be accessed?
>
> I would suggest you first fix the ordering in dsa_switch_destroy()
> and then add the missing netif_carrier_off() and phy_disconnect().
>
> Thanks
> Andrew
>
Yes, you are right, I will submit a cleaned up version.
I forgot the fixed phy case actually.
Thanks,
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists