aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/cls_api.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index ab255b421781..7d97f612c9b9 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -205,13 +205,14 @@ static void tcf_chain_head_change(struct tcf_chain *chain,
205 205
206static void tcf_chain_flush(struct tcf_chain *chain) 206static void tcf_chain_flush(struct tcf_chain *chain)
207{ 207{
208 struct tcf_proto *tp; 208 struct tcf_proto *tp = rtnl_dereference(chain->filter_chain);
209 209
210 tcf_chain_head_change(chain, NULL); 210 tcf_chain_head_change(chain, NULL);
211 while ((tp = rtnl_dereference(chain->filter_chain)) != NULL) { 211 while (tp) {
212 RCU_INIT_POINTER(chain->filter_chain, tp->next); 212 RCU_INIT_POINTER(chain->filter_chain, tp->next);
213 tcf_chain_put(chain);
214 tcf_proto_destroy(tp); 213 tcf_proto_destroy(tp);
214 tp = rtnl_dereference(chain->filter_chain);
215 tcf_chain_put(chain);
215 } 216 }
216} 217}
217 218