net: dsa: bcm_sf2: Do not assume DSA master supports WoL
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 15 Feb 2019 20:16:52 +0000 (12:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:49 +0000 (20:09 +0100)
commit90a86d00af1a379255e051a9f446366ffe9fe5b6
treef5b357696d0050b95ab2a1a47aa86685f8557fcf
parentd33f5a0febfa6abe3f4fa0db540e4eb634f4ec5b
net: dsa: bcm_sf2: Do not assume DSA master supports WoL

[ Upstream commit c3152ec4c0691e351f35a2f63347a464b5f35151 ]

We assume in the bcm_sf2 driver that the DSA master network device
supports ethtool_ops::{get,set}_wol operations, which is not a given.
Avoid de-referencing potentially non-existent function pointers and
check them as we should.

Fixes: 96e65d7f3f88 ("net: dsa: bcm_sf2: add support for Wake-on-LAN")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/bcm_sf2.c