net: sched: fix typo in walker_check_empty()
authorVlad Buslov <vladbu@mellanox.com>
Tue, 26 Feb 2019 15:34:40 +0000 (17:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Feb 2019 17:17:49 +0000 (09:17 -0800)
Function walker_check_empty() incorrectly verifies that tp pointer is not
NULL, instead of actual filter pointer. Fix conditional to check the right
pointer. Adjust filter pointer naming accordingly to other cls API
functions.

Fixes: 6676d5e416ee ("net: sched: set dedicated tcf_walker flag when tp is empty")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c

index befc06f658dff4b64da0a1099d335c7867e62cc0..478095d50f95bb5ded3f224e7f88d92fd96ec3a7 100644 (file)
@@ -238,10 +238,10 @@ static void tcf_proto_put(struct tcf_proto *tp, bool rtnl_held,
                tcf_proto_destroy(tp, rtnl_held, extack);
 }
 
-static int walker_check_empty(struct tcf_proto *tp, void *d,
+static int walker_check_empty(struct tcf_proto *tp, void *fh,
                              struct tcf_walker *arg)
 {
-       if (tp) {
+       if (fh) {
                arg->nonempty = true;
                return -1;
        }