diff options
Diffstat (limited to 'net/sched/cls_basic.c')
-rw-r--r-- | net/sched/cls_basic.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index fc399db86f11..0b8c3ace671f 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c | |||
@@ -96,11 +96,14 @@ static void basic_delete_filter(struct rcu_head *head) | |||
96 | kfree(f); | 96 | kfree(f); |
97 | } | 97 | } |
98 | 98 | ||
99 | static void basic_destroy(struct tcf_proto *tp) | 99 | static bool basic_destroy(struct tcf_proto *tp, bool force) |
100 | { | 100 | { |
101 | struct basic_head *head = rtnl_dereference(tp->root); | 101 | struct basic_head *head = rtnl_dereference(tp->root); |
102 | struct basic_filter *f, *n; | 102 | struct basic_filter *f, *n; |
103 | 103 | ||
104 | if (!force && !list_empty(&head->flist)) | ||
105 | return false; | ||
106 | |||
104 | list_for_each_entry_safe(f, n, &head->flist, link) { | 107 | list_for_each_entry_safe(f, n, &head->flist, link) { |
105 | list_del_rcu(&f->link); | 108 | list_del_rcu(&f->link); |
106 | tcf_unbind_filter(tp, &f->res); | 109 | tcf_unbind_filter(tp, &f->res); |
@@ -108,6 +111,7 @@ static void basic_destroy(struct tcf_proto *tp) | |||
108 | } | 111 | } |
109 | RCU_INIT_POINTER(tp->root, NULL); | 112 | RCU_INIT_POINTER(tp->root, NULL); |
110 | kfree_rcu(head, rcu); | 113 | kfree_rcu(head, rcu); |
114 | return true; | ||
111 | } | 115 | } |
112 | 116 | ||
113 | static int basic_delete(struct tcf_proto *tp, unsigned long arg) | 117 | static int basic_delete(struct tcf_proto *tp, unsigned long arg) |