[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR04MB47994BB92D3E766C6B4E37C9F2850@VI1PR04MB4799.eurprd04.prod.outlook.com>
Date: Fri, 11 Jan 2019 14:09:40 +0000
From: Camelia Alexandra Groza <camelia.groza@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: "f.fainelli@...il.com" <f.fainelli@...il.com>,
"hkallweit1@...il.com" <hkallweit1@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"oss@...error.net" <oss@...error.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net] net: phy: guard against accessing a NULL features
bitmap
> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Friday, January 11, 2019 15:38
> To: Camelia Alexandra Groza <camelia.groza@....com>
> Cc: f.fainelli@...il.com; hkallweit1@...il.com; davem@...emloft.net;
> oss@...error.net; netdev@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH net] net: phy: guard against accessing a NULL features
> bitmap
>
> On Fri, Jan 11, 2019 at 01:56:46PM +0200, Camelia Groza wrote:
> > Since phy driver features became a link_mode bitmap, phy drivers that
> > don't have a list of features configured will cause the kernel to crash
> > when probed.
>
> Hi Camelia
>
> A NULL features is a driver bug. So i would prefer to solve this
> differently.
>
> Please make phy_driver_register() do a WARN_ON(!new_driver->features)
> and return -EINVAL.
I wasn't aware that features are mandatory. I'll make the change.
> Do you know of a specific driver which as a NULL value? We should fix
> that as well.
Yes, there are five drivers that don't have features configured: BCM8706, BCM8727, CS4340, TN2020 and KSZ8873MLL.
I'm planning to send patches on net-next for the Cortina and Teranetics ones at least, but fixing the generic crash was my priority.
Thanks,
Camelia
Powered by blists - more mailing lists