From a5b5c958ffd1610545d6b4b8290aa9c5266d10fa Mon Sep 17 00:00:00 2001 From: WANG Cong Date: Tue, 11 Feb 2014 17:07:32 -0800 Subject: net_sched: act: refactor cleanup ops For bindcnt and refcnt etc., they are common for all actions, not need to repeat such operations for their own, they can be unified now. Actions just need to do its specific cleanup if needed. Cc: Jamal Hadi Salim Cc: David S. Miller Signed-off-by: Cong Wang Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller --- net/sched/act_pedit.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'net/sched/act_pedit.c') diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 091ced38a37..8aa795b275f 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -99,18 +99,11 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, return ret; } -static int tcf_pedit_cleanup(struct tc_action *a, int bind) +static void tcf_pedit_cleanup(struct tc_action *a, int bind) { struct tcf_pedit *p = a->priv; - - if (p) { - struct tc_pedit_key *keys = p->tcfp_keys; - if (tcf_hash_release(a, bind)) { - kfree(keys); - return 1; - } - } - return 0; + struct tc_pedit_key *keys = p->tcfp_keys; + kfree(keys); } static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a, -- cgit v1.2.3-18-g5258