hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/ethtool/ioctl.c
....@@ -1966,7 +1966,8 @@
19661966 } else {
19671967 /* Driver expects to be called at twice the frequency in rc */
19681968 int n = rc * 2, interval = HZ / n;
1969
- u64 count = n * id.data, i = 0;
1969
+ u64 count = mul_u32_u32(n, id.data);
1970
+ u64 i = 0;
19701971
19711972 do {
19721973 rtnl_lock();
....@@ -2051,7 +2052,8 @@
20512052 return n_stats;
20522053 if (n_stats > S32_MAX / sizeof(u64))
20532054 return -ENOMEM;
2054
- WARN_ON_ONCE(!n_stats);
2055
+ if (WARN_ON_ONCE(!n_stats))
2056
+ return -EOPNOTSUPP;
20552057
20562058 if (copy_from_user(&stats, useraddr, sizeof(stats)))
20572059 return -EFAULT;