aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r--net/sched/act_api.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index cd69a6afcf88..00bf7d2b0bdd 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -337,9 +337,8 @@ bool tcf_idr_check(struct tc_action_net *tn, u32 index, struct tc_action **a,
337} 337}
338EXPORT_SYMBOL(tcf_idr_check); 338EXPORT_SYMBOL(tcf_idr_check);
339 339
340int tcf_idr_delete_index(struct tc_action_net *tn, u32 index) 340static int tcf_idr_delete_index(struct tcf_idrinfo *idrinfo, u32 index)
341{ 341{
342 struct tcf_idrinfo *idrinfo = tn->idrinfo;
343 struct tc_action *p; 342 struct tc_action *p;
344 int ret = 0; 343 int ret = 0;
345 344
@@ -370,7 +369,6 @@ int tcf_idr_delete_index(struct tc_action_net *tn, u32 index)
370 spin_unlock(&idrinfo->lock); 369 spin_unlock(&idrinfo->lock);
371 return ret; 370 return ret;
372} 371}
373EXPORT_SYMBOL(tcf_idr_delete_index);
374 372
375int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, 373int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
376 struct tc_action **a, const struct tc_action_ops *ops, 374 struct tc_action **a, const struct tc_action_ops *ops,
@@ -1182,24 +1180,25 @@ err_out:
1182static int tcf_action_delete(struct net *net, struct tc_action *actions[], 1180static int tcf_action_delete(struct net *net, struct tc_action *actions[],
1183 struct netlink_ext_ack *extack) 1181 struct netlink_ext_ack *extack)
1184{ 1182{
1185 u32 act_index; 1183 int i;
1186 int ret, i;
1187 1184
1188 for (i = 0; i < TCA_ACT_MAX_PRIO && actions[i]; i++) { 1185 for (i = 0; i < TCA_ACT_MAX_PRIO && actions[i]; i++) {
1189 struct tc_action *a = actions[i]; 1186 struct tc_action *a = actions[i];
1190 const struct tc_action_ops *ops = a->ops; 1187 const struct tc_action_ops *ops = a->ops;
1191
1192 /* Actions can be deleted concurrently so we must save their 1188 /* Actions can be deleted concurrently so we must save their
1193 * type and id to search again after reference is released. 1189 * type and id to search again after reference is released.
1194 */ 1190 */
1195 act_index = a->tcfa_index; 1191 struct tcf_idrinfo *idrinfo = a->idrinfo;
1192 u32 act_index = a->tcfa_index;
1196 1193
1197 if (tcf_action_put(a)) { 1194 if (tcf_action_put(a)) {
1198 /* last reference, action was deleted concurrently */ 1195 /* last reference, action was deleted concurrently */
1199 module_put(ops->owner); 1196 module_put(ops->owner);
1200 } else { 1197 } else {
1198 int ret;
1199
1201 /* now do the delete */ 1200 /* now do the delete */
1202 ret = ops->delete(net, act_index); 1201 ret = tcf_idr_delete_index(idrinfo, act_index);
1203 if (ret < 0) 1202 if (ret < 0)
1204 return ret; 1203 return ret;
1205 } 1204 }