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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:21 +0000 (19:47 +0100)
commitc8dfab5c610f091585d06cf205bd85983cf37ea5
tree7f3f2f9697e719ce4902afa241ac8796a01e980b
parent98cedccb86542db05c152d4a1edd2151af6165c9
net: dsa: Fix NULL checking in dsa_slave_set_eee()

[ Upstream commit 00670cb8a73b10b10d3c40f045c15411715e4465 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dsa/slave.c