net: dsa: Fix NULL checking in dsa_slave_set_eee()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Feb 2019 15:35:15 +0000 (18:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Feb 2019 21:42:54 +0000 (13:42 -0800)
commit00670cb8a73b10b10d3c40f045c15411715e4465
treec6ea6278589659c3bbd1144abaf0bde8409382ce
parent2b1f86bf741a3220b4471fef197631d6e2264983
net: dsa: Fix NULL checking in dsa_slave_set_eee()

This function can't succeed if dp->pl is NULL.  It will Oops inside the
call to return phylink_ethtool_get_eee(dp->pl, e);

Fixes: 1be52e97ed3e ("dsa: slave: eee: Allow ports to use phylink")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c