From 92b9ce75e178b65c8f1ecf493b44baa7e6721705 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:49 +0100 Subject: [PATCH] Revert "ethtool: check device is present when getting link settings" This reverts commit ef4f72282f5dea09afca207b3134b4efdf1695b7. --- net/core/net-sysfs.c | 2 +- net/ethtool/ioctl.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 86721e0d9..631adc603 100755 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -213,7 +213,7 @@ static ssize_t speed_show(struct device *dev, if (!rtnl_trylock()) return restart_syscall(); - if (netif_running(netdev)) { + if (netif_running(netdev) && netif_device_present(netdev)) { struct ethtool_link_ksettings cmd; if (!__ethtool_get_link_ksettings(netdev, &cmd)) diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 0a588545d..12bf740e2 100755 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -432,9 +432,6 @@ int __ethtool_get_link_ksettings(struct net_device *dev, if (!dev->ethtool_ops->get_link_ksettings) return -EOPNOTSUPP; - if (!netif_device_present(dev)) - return -ENODEV; - memset(link_ksettings, 0, sizeof(*link_ksettings)); return dev->ethtool_ops->get_link_ksettings(dev, link_ksettings); }