From: Zhengchao Shao Date: Tue, 27 Sep 2022 12:48:53 +0000 (+0800) Subject: net: sched: ensure n arg not empty before call bind_class X-Git-Tag: baikal/mips/sdk6.1~4743^2~21^2~2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=5916b70ebb964b33a10d1fabb47e1f0372a204d5;p=kernel.git net: sched: ensure n arg not empty before call bind_class All bind_class callbacks are directly returned when n arg is empty. Therefore, bind_class is invoked only when n arg is not empty. Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 7c15f1f3da177..c98af0ada706e 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1915,7 +1915,7 @@ static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg) { struct tcf_bind_args *a = (void *)arg; - if (tp->ops->bind_class) { + if (n && tp->ops->bind_class) { struct Qdisc *q = tcf_block_q(tp->chain->block); sch_tree_lock(q);