Commit 662222ae authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Jeff Garzik

[ethtool] fix ethtool_get_strings counting bug

parent dc94c230
...@@ -502,15 +502,15 @@ static int ethtool_get_strings(struct net_device *dev, void *useraddr) ...@@ -502,15 +502,15 @@ static int ethtool_get_strings(struct net_device *dev, void *useraddr)
switch (gstrings.string_set) { switch (gstrings.string_set) {
case ETH_SS_TEST: case ETH_SS_TEST:
if (ops->self_test_count) if (!ops->self_test_count)
gstrings.len = ops->self_test_count(dev);
else
return -EOPNOTSUPP; return -EOPNOTSUPP;
gstrings.len = ops->self_test_count(dev);
break;
case ETH_SS_STATS: case ETH_SS_STATS:
if (ops->get_stats_count) if (!ops->get_stats_count)
gstrings.len = ops->get_stats_count(dev);
else
return -EOPNOTSUPP; return -EOPNOTSUPP;
gstrings.len = ops->get_stats_count(dev);
break;
default: default:
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment