projects
/
platform
/
kernel
/
linux-rpi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats
[platform/kernel/linux-rpi.git]
/
net
/
ethtool
/
ioctl.c
diff --git
a/net/ethtool/ioctl.c
b/net/ethtool/ioctl.c
index
6991d77
..
939c63d
100644
(file)
--- a/
net/ethtool/ioctl.c
+++ b/
net/ethtool/ioctl.c
@@
-2074,7
+2074,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;