Re: [PATCH net] net: dsa: Ensure validity of dst->ds[0]

2017-01-10 Thread David Miller
From: Florian Fainelli Date: Mon, 9 Jan 2017 11:58:34 -0800 > It is perfectly possible to have non zero indexed switches being present > in a DSA switch tree, in such a case, we will be deferencing a NULL > pointer while dsa_cpu_port_ethtool_{setup,restore}. Be more defensive > and ensure that d

Re: [PATCH net] net: dsa: Ensure validity of dst->ds[0]

2017-01-09 Thread Andrew Lunn
On Mon, Jan 09, 2017 at 03:50:53PM -0500, Vivien Didelot wrote: > Hi Florian, > > Florian Fainelli writes: > > > It is perfectly possible to have non zero indexed switches being present > > in a DSA switch tree, in such a case, we will be deferencing a NULL > > pointer while dsa_cpu_port_ethtool

Re: [PATCH net] net: dsa: Ensure validity of dst->ds[0]

2017-01-09 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > It is perfectly possible to have non zero indexed switches being present > in a DSA switch tree, in such a case, we will be deferencing a NULL > pointer while dsa_cpu_port_ethtool_{setup,restore}. Be more defensive > and ensure that dst->ds[0] is valid befo

[PATCH net] net: dsa: Ensure validity of dst->ds[0]

2017-01-09 Thread Florian Fainelli
It is perfectly possible to have non zero indexed switches being present in a DSA switch tree, in such a case, we will be deferencing a NULL pointer while dsa_cpu_port_ethtool_{setup,restore}. Be more defensive and ensure that dst->ds[0] is valid before doing anything with it. Fixes: 0c73c523cf73