Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sr9800: Check for supported Wake-on-LAN modes

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: 19a38d8e0aa3 ("USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Fainelli and committed by
David S. Miller
c5cb93e9 eb9ad088

+3
+3
drivers/net/usb/sr9800.c
··· 421 421 struct usbnet *dev = netdev_priv(net); 422 422 u8 opt = 0; 423 423 424 + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) 425 + return -EINVAL; 426 + 424 427 if (wolinfo->wolopts & WAKE_PHY) 425 428 opt |= SR_MONITOR_LINK; 426 429 if (wolinfo->wolopts & WAKE_MAGIC)