Message ID | 20221226114825.1937189-2-d-tatianin@yandex-team.ru (mailing list archive) |
---|---|
State | Accepted |
Commit | 9deb1e9fb88b1120a908676fa33bdf9e2eeaefce |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers | expand |
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 57e7238a4136..e8a294b38b7b 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -2093,7 +2093,8 @@ static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr) return n_stats; if (n_stats > S32_MAX / sizeof(u64)) return -ENOMEM; - WARN_ON_ONCE(!n_stats); + if (WARN_ON_ONCE(!n_stats)) + return -EOPNOTSUPP; if (copy_from_user(&stats, useraddr, sizeof(stats))) return -EFAULT;