Thread (15 messages) flat view 15 messages, 3 authors, 2018-09-27
STALE2921d

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2018-09-24 20:56:07
Also in: linux-usb, lkml
Subsystem: networking drivers, the rest, usb lan78xx ethernet driver, usb networking drivers · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Thangaraj Samynathan

The driver supports a fair amount of Wake-on-LAN modes, but is not
checking that the user specified one that is supported.

Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/usb/lan78xx.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index a9991c5f4736..e0a588d1b8e6 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -1415,6 +1415,9 @@ static int lan78xx_set_wol(struct net_device *netdev,
 	if (wol->wolopts & WAKE_ARP)
 		pdata->wol |= WAKE_ARP;
 
+	if (pdata->wol == 0)
+		return -EINVAL;
+
 	device_set_wakeup_enable(&dev->udev->dev, (bool)wol->wolopts);
 
 	phy_ethtool_set_wol(netdev->phydev, wol);
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help