aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_pedit.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-02-11 20:07:32 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-12 19:23:32 -0500
commita5b5c958ffd1610545d6b4b8290aa9c5266d10fa (patch)
tree532a87c5ae6d0c2f2f766820c051f7a5b8f7a366 /net/sched/act_pedit.c
parent86062033feb8a1692f7a3d570c652f1b4a4b4b52 (diff)
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 <jhs@mojatatu.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_pedit.c')
-rw-r--r--net/sched/act_pedit.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 091ced38a376..8aa795b275f2 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,
99 return ret; 99 return ret;
100} 100}
101 101
102static int tcf_pedit_cleanup(struct tc_action *a, int bind) 102static void tcf_pedit_cleanup(struct tc_action *a, int bind)
103{ 103{
104 struct tcf_pedit *p = a->priv; 104 struct tcf_pedit *p = a->priv;
105 105 struct tc_pedit_key *keys = p->tcfp_keys;
106 if (p) { 106 kfree(keys);
107 struct tc_pedit_key *keys = p->tcfp_keys;
108 if (tcf_hash_release(a, bind)) {
109 kfree(keys);
110 return 1;
111 }
112 }
113 return 0;
114} 107}
115 108
116static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a, 109static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,