diff options
Diffstat (limited to 'net/sched/act_skbmod.c')
-rw-r--r-- | net/sched/act_skbmod.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index febec75f4f7a..142a996ac776 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c | |||
@@ -152,7 +152,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla, | |||
152 | ASSERT_RTNL(); | 152 | ASSERT_RTNL(); |
153 | p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL); | 153 | p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL); |
154 | if (unlikely(!p)) { | 154 | if (unlikely(!p)) { |
155 | if (ovr) | 155 | if (ret == ACT_P_CREATED) |
156 | tcf_idr_release(*a, bind); | 156 | tcf_idr_release(*a, bind); |
157 | return -ENOMEM; | 157 | return -ENOMEM; |
158 | } | 158 | } |
@@ -190,7 +190,8 @@ static void tcf_skbmod_cleanup(struct tc_action *a) | |||
190 | struct tcf_skbmod_params *p; | 190 | struct tcf_skbmod_params *p; |
191 | 191 | ||
192 | p = rcu_dereference_protected(d->skbmod_p, 1); | 192 | p = rcu_dereference_protected(d->skbmod_p, 1); |
193 | kfree_rcu(p, rcu); | 193 | if (p) |
194 | kfree_rcu(p, rcu); | ||
194 | } | 195 | } |
195 | 196 | ||
196 | static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a, | 197 | static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a, |