From: Jiri Pirko Subject: [patch net 2/2] net: sched: return -ENOENT when trying to remove filter from non-existent chain Date: Mon, 27 Aug 2018 20:58:44 +0200 Message-ID: <20180827185844.4517-3-jiri@resnulli.us> References: <20180827185844.4517-1-jiri@resnulli.us> Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mrv@mojatatu.com, mlxsw@mellanox.com To: netdev@vger.kernel.org Return-path: Received: from mail-wr1-f66.google.com ([209.85.221.66]:35415 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727511AbeH0Wqi (ORCPT ); Mon, 27 Aug 2018 18:46:38 -0400 Received: by mail-wr1-f66.google.com with SMTP id j26-v6so28004wre.2 for ; Mon, 27 Aug 2018 11:58:48 -0700 (PDT) In-Reply-To: <20180827185844.4517-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko 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 Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation") Signed-off-by: Jiri Pirko --- net/sched/cls_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 2d41c5b21b48..1a67af8a6e8c 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -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; } -- 2.14.4