Skip to content

Commit f07fed8

Browse files
congwangdavem330
authored andcommitted
net_sched: remove the leftover cleanup_a()
After refactoring tc_action into tcf_common, we no longer need to cleanup temporary "actions" in list, they are permanently stored in the hashtable. Fixes: a85a970 ("net_sched: move tc_action into tcf_common") Reported-by: Jamal Hadi Salim <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f4abf05 commit f07fed8

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

net/sched/act_api.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -754,16 +754,6 @@ static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla,
754754
return ERR_PTR(err);
755755
}
756756

757-
static void cleanup_a(struct list_head *actions)
758-
{
759-
struct tc_action *a, *tmp;
760-
761-
list_for_each_entry_safe(a, tmp, actions, list) {
762-
list_del(&a->list);
763-
kfree(a);
764-
}
765-
}
766-
767757
static int tca_action_flush(struct net *net, struct nlattr *nla,
768758
struct nlmsghdr *n, u32 portid)
769759
{
@@ -905,7 +895,7 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
905895
return ret;
906896
}
907897
err:
908-
cleanup_a(&actions);
898+
tcf_action_destroy(&actions, 0);
909899
return ret;
910900
}
911901

@@ -942,15 +932,9 @@ tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
942932

943933
ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
944934
if (ret)
945-
goto done;
935+
return ret;
946936

947-
/* dump then free all the actions after update; inserted policy
948-
* stays intact
949-
*/
950-
ret = tcf_add_notify(net, n, &actions, portid);
951-
cleanup_a(&actions);
952-
done:
953-
return ret;
937+
return tcf_add_notify(net, n, &actions, portid);
954938
}
955939

956940
static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)

0 commit comments

Comments
 (0)