diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-09-28 16:18:50 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-04 14:52:39 +0100 |
commit | eef5935c2d7a349479c6992ddb60b2c4d9e17263 (patch) | |
tree | 88eb1e4297dbc007c6b26b10e96865ad43f5a54f /drivers | |
parent | 915670c48eb3d073ef8dc29a12db92cbde233195 (diff) | |
download | linux-stable-eef5935c2d7a349479c6992ddb60b2c4d9e17263.tar.gz linux-stable-eef5935c2d7a349479c6992ddb60b2c4d9e17263.tar.bz2 linux-stable-eef5935c2d7a349479c6992ddb60b2c4d9e17263.zip |
asix: Check for supported Wake-on-LAN modes
[ Upstream commit c4ce446e33d7a0e978256ac6fea4c80e59d9de5f ]
The driver currently silently accepts unsupported Wake-on-LAN modes
(other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user,
which is confusing.
Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters")
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/asix_common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c index 522d2900cd1d..e9fcf6ef716a 100644 --- a/drivers/net/usb/asix_common.c +++ b/drivers/net/usb/asix_common.c @@ -607,6 +607,9 @@ int asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= AX_MONITOR_LINK; if (wolinfo->wolopts & WAKE_MAGIC) |