aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/cls_rsvp.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index bdbc541787f8..cf325625c99d 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -285,13 +285,19 @@ static int rsvp_init(struct tcf_proto *tp)
285 return -ENOBUFS; 285 return -ENOBUFS;
286} 286}
287 287
288static void __rsvp_delete_filter(struct rsvp_filter *f)
289{
290 tcf_exts_destroy(&f->exts);
291 tcf_exts_put_net(&f->exts);
292 kfree(f);
293}
294
288static void rsvp_delete_filter_work(struct work_struct *work) 295static void rsvp_delete_filter_work(struct work_struct *work)
289{ 296{
290 struct rsvp_filter *f = container_of(work, struct rsvp_filter, work); 297 struct rsvp_filter *f = container_of(work, struct rsvp_filter, work);
291 298
292 rtnl_lock(); 299 rtnl_lock();
293 tcf_exts_destroy(&f->exts); 300 __rsvp_delete_filter(f);
294 kfree(f);
295 rtnl_unlock(); 301 rtnl_unlock();
296} 302}
297 303
@@ -310,7 +316,10 @@ static void rsvp_delete_filter(struct tcf_proto *tp, struct rsvp_filter *f)
310 * grace period, since converted-to-rcu actions are relying on that 316 * grace period, since converted-to-rcu actions are relying on that
311 * in cleanup() callback 317 * in cleanup() callback
312 */ 318 */
313 call_rcu(&f->rcu, rsvp_delete_filter_rcu); 319 if (tcf_exts_get_net(&f->exts))
320 call_rcu(&f->rcu, rsvp_delete_filter_rcu);
321 else
322 __rsvp_delete_filter(f);
314} 323}
315 324
316static void rsvp_destroy(struct tcf_proto *tp) 325static void rsvp_destroy(struct tcf_proto *tp)