Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit4392053

Browse files
congwangdavem330
authored andcommitted
net_sched: remove useless NULL to tp->root
There is no need to NULL tp->root in ->destroy(), since tp isgoing to be freed very soon, and existing readers are stillsafe to read them.For cls_route, we always init its tp->root, so it can't be NULL,we can drop more useless code.Cc: Daniel Borkmann <daniel@iogearbox.net>Cc: John Fastabend <john.fastabend@gmail.com>Cc: Jamal Hadi Salim <jhs@mojatatu.com>Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent763dbf6 commit4392053

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

‎net/sched/cls_fw.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ static void fw_destroy(struct tcf_proto *tp)
144144
call_rcu(&f->rcu,fw_delete_filter);
145145
}
146146
}
147-
RCU_INIT_POINTER(tp->root,NULL);
148147
kfree_rcu(head,rcu);
149148
}
150149

‎net/sched/cls_route.c‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp,
140140
gotofailure;
141141

142142
id=dst->tclassid;
143-
if (head==NULL)
144-
gotoold_method;
145143

146144
iif=inet_iif(skb);
147145

@@ -194,15 +192,6 @@ static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp,
194192
route4_set_fastmap(head,id,iif,ROUTE4_FAILURE);
195193
failure:
196194
return-1;
197-
198-
old_method:
199-
if (id&& (TC_H_MAJ(id)==0||
200-
!(TC_H_MAJ(id^tp->q->handle)))) {
201-
res->classid=id;
202-
res->class=0;
203-
return0;
204-
}
205-
return-1;
206195
}
207196

208197
staticinlineu32to_hash(u32id)
@@ -234,9 +223,6 @@ static unsigned long route4_get(struct tcf_proto *tp, u32 handle)
234223
structroute4_filter*f;
235224
unsignedinth1,h2;
236225

237-
if (!head)
238-
return0;
239-
240226
h1=to_hash(handle);
241227
if (h1>256)
242228
return0;
@@ -305,7 +291,6 @@ static void route4_destroy(struct tcf_proto *tp)
305291
kfree_rcu(b,rcu);
306292
}
307293
}
308-
RCU_INIT_POINTER(tp->root,NULL);
309294
kfree_rcu(head,rcu);
310295
}
311296

‎net/sched/cls_rsvp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ static int rsvp_classify(struct sk_buff *skb, const struct tcf_proto *tp,
152152
return-1;
153153
nhptr=ip_hdr(skb);
154154
#endif
155-
if (unlikely(!head))
156-
return-1;
157155
restart:
158156

159157
#ifRSVP_DST_LEN==4
@@ -310,8 +308,6 @@ static void rsvp_destroy(struct tcf_proto *tp)
310308
if (data==NULL)
311309
return;
312310

313-
RCU_INIT_POINTER(tp->root,NULL);
314-
315311
for (h1=0;h1<256;h1++) {
316312
structrsvp_session*s;
317313

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp