aboutsummaryrefslogtreecommitdiff
path: root/net/sched/act_skbmod.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-06-01 11:40:19 +0100
committerMark Brown <broonie@kernel.org>2018-06-01 11:40:19 +0100
commit91983dd5325297de4a2b6e1e3f22497604b6c687 (patch)
tree82a440219533c59dde336b383f89bcfe43da3aa5 /net/sched/act_skbmod.c
parentc36e3982af7020ff66886b6a7d673a8a471c4eac (diff)
parent9c465aceb29ae6033c9021cc38a7dd219d9edb43 (diff)
Merge branch 'linux-linaro-lsk-v4.14' into linux-linaro-lsk-v4.14-rtlsk-v4.14-18.05-rt
Diffstat (limited to 'net/sched/act_skbmod.c')
-rw-r--r--net/sched/act_skbmod.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c
index 6d10b3af479b..d227599f7e73 100644
--- a/net/sched/act_skbmod.c
+++ b/net/sched/act_skbmod.c
@@ -131,8 +131,11 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
if (exists && bind)
return 0;
- if (!lflags)
+ if (!lflags) {
+ if (exists)
+ tcf_idr_release(*a, bind);
return -EINVAL;
+ }
if (!exists) {
ret = tcf_idr_create(tn, parm->index, est, a,
@@ -152,7 +155,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
ASSERT_RTNL();
p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL);
if (unlikely(!p)) {
- if (ovr)
+ if (ret == ACT_P_CREATED)
tcf_idr_release(*a, bind);
return -ENOMEM;
}