diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 0762aaf8e964ec4c517984fdff8ddfdc4afef99e..192f2f76b7bdaa9eb3d12d76686fc73cad825e6f 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -1015,6 +1015,9 @@ static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, return -EINVAL; } + if (info.cmd != cmd) + return -EINVAL; + if (info.cmd == ETHTOOL_GRXCLSRLALL) { if (info.rule_cnt > 0) { if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32))