projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc37b24
)
net: sched: ensure n arg not empty before call bind_class
author
Zhengchao Shao
<shaozhengchao@huawei.com>
Tue, 27 Sep 2022 12:48:53 +0000
(20:48 +0800)
committer
David S. Miller
<davem@davemloft.net>
Sun, 2 Oct 2022 15:07:17 +0000
(16:07 +0100)
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 <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_api.c
patch
|
blob
|
history
diff --git
a/net/sched/sch_api.c
b/net/sched/sch_api.c
index 7c15f1f3da1770e74aa80eaf89a06a3122d5db59..c98af0ada706efee202a20a6bfb6f2b984106f45 100644
(file)
--- 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);