+ker...@armlinux.org.uk;
>> maowenan; Florian Fainelli
>> Subject: [PATCH net v2 1/3] net: phy: Fix PHY module checks
>>
>> The Generic PHY drivers gets assigned after we checked that the current PHY
>> driver is NULL, so we need to check a few things before we can safely
On 02/08/2017 08:57 AM, Andrew Lunn wrote:
>> --- a/drivers/net/phy/phy_device.c
>> +++ b/drivers/net/phy/phy_device.c
>> @@ -920,7 +920,7 @@ int phy_attach_direct(struct net_device *dev, struct
>> phy_device *phydev,
>> return -EIO;
>> }
>>
>> -if (!try_module_get(d->drive
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -920,7 +920,7 @@ int phy_attach_direct(struct net_device *dev, struct
> phy_device *phydev,
> return -EIO;
> }
>
> - if (!try_module_get(d->driver->owner)) {
> + if (d->driver && !try_modul
On Wed, Feb 8, 2017 at 5:37 AM, Florian Fainelli wrote:
> The Generic PHY drivers gets assigned after we checked that the current PHY
> driver is NULL, so we need to check a few things before we can safely
> derference d->driver. Update phy_attach_direct() and phy_detach() accordingly
> to be resi
> -Original Message-
> From: Florian Fainelli [mailto:f.faine...@gmail.com]
> Sent: Wednesday, February 08, 2017 3:38 PM
> To: netdev@vger.kernel.org
> Cc: da...@davemloft.net; and...@lunn.ch; rmk+ker...@armlinux.org.uk;
> maowenan; Florian Fainelli
> Subject: [PATCH
The Generic PHY drivers gets assigned after we checked that the current PHY
driver is NULL, so we need to check a few things before we can safely
derference d->driver. Update phy_attach_direct() and phy_detach() accordingly
to be resilient to these cases.
Even though the Generic PHY driver default