summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2020-09-07 11:04:38 -0700
committerDavid S. Miller <davem@davemloft.net>2020-09-08 19:34:36 -0700
commitc1f1f16c4de407fa1924e3aa4ddbc567c0a86095 (patch)
tree1e1d78dc591be5ee57e66848e0aead6894485a17 /net/sched
parent4349abdb409b04a5ed4ca4d2c1df7ef0cc16f6bd (diff)
net: sched: skip an unnecessay check
Reviewing the error handling in tcf_action_init_1() most of the early handling uses err_out: if (cookie) { kfree(cookie->data); kfree(cookie); } before cookie could ever be set. So skip the unnecessay check. Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 063d8aaf2900..f64af9d9dfee 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -976,7 +976,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
#endif
NL_SET_ERR_MSG(extack, "Failed to load TC action module");
err = -ENOENT;
- goto err_out;
+ goto err_free;
}
/* backward compatibility for policer */
@@ -1013,11 +1013,12 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
err_mod:
module_put(a_o->owner);
-err_out:
+err_free:
if (cookie) {
kfree(cookie->data);
kfree(cookie);
}
+err_out:
return ERR_PTR(err);
}