aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_route.c')
-rw-r--r--net/sched/cls_route.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index b665aee661f7..6f22baae0afa 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -269,9 +269,7 @@ static void
269route4_delete_filter(struct rcu_head *head) 269route4_delete_filter(struct rcu_head *head)
270{ 270{
271 struct route4_filter *f = container_of(head, struct route4_filter, rcu); 271 struct route4_filter *f = container_of(head, struct route4_filter, rcu);
272 struct tcf_proto *tp = f->tp;
273 272
274 tcf_unbind_filter(tp, &f->res);
275 tcf_exts_destroy(&f->exts); 273 tcf_exts_destroy(&f->exts);
276 kfree(f); 274 kfree(f);
277} 275}
@@ -297,6 +295,7 @@ static void route4_destroy(struct tcf_proto *tp)
297 295
298 next = rtnl_dereference(f->next); 296 next = rtnl_dereference(f->next);
299 RCU_INIT_POINTER(b->ht[h2], next); 297 RCU_INIT_POINTER(b->ht[h2], next);
298 tcf_unbind_filter(tp, &f->res);
300 call_rcu(&f->rcu, route4_delete_filter); 299 call_rcu(&f->rcu, route4_delete_filter);
301 } 300 }
302 } 301 }
@@ -338,6 +337,7 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
338 route4_reset_fastmap(head); 337 route4_reset_fastmap(head);
339 338
340 /* Delete it */ 339 /* Delete it */
340 tcf_unbind_filter(tp, &f->res);
341 call_rcu(&f->rcu, route4_delete_filter); 341 call_rcu(&f->rcu, route4_delete_filter);
342 342
343 /* Strip RTNL protected tree */ 343 /* Strip RTNL protected tree */
@@ -545,8 +545,10 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
545 545
546 route4_reset_fastmap(head); 546 route4_reset_fastmap(head);
547 *arg = (unsigned long)f; 547 *arg = (unsigned long)f;
548 if (fold) 548 if (fold) {
549 tcf_unbind_filter(tp, &fold->res);
549 call_rcu(&fold->rcu, route4_delete_filter); 550 call_rcu(&fold->rcu, route4_delete_filter);
551 }
550 return 0; 552 return 0;
551 553
552errout: 554errout: