]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: sched: return -ENOENT when trying to remove filter from non-existent chain
authorJiri Pirko <jiri@mellanox.com>
Mon, 27 Aug 2018 18:58:44 +0000 (20:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Aug 2018 22:16:16 +0000 (15:16 -0700)
When chain 0 was implicitly created, removal of non-existent filter from
chain 0 gave -ENOENT. Once chain 0 became non-implicit, the same call is
giving -EINVAL. Fix this by returning -ENOENT in that case.

Reported-by: Roman Mashak <mrv@mojatatu.com>
Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c

index 2d41c5b21b487c194280d8f9610f23e4e9d06341..1a67af8a6e8ce93bc9821804567d738b4d4547e5 100644 (file)
@@ -1399,7 +1399,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
                        goto errout;
                }
                NL_SET_ERR_MSG(extack, "Cannot find specified filter chain");
-               err = -EINVAL;
+               err = -ENOENT;
                goto errout;
        }