Commit c1f1f16c authored by Tom Rix's avatar Tom Rix Committed by David S. Miller

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: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4349abdb
...@@ -976,7 +976,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, ...@@ -976,7 +976,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
#endif #endif
NL_SET_ERR_MSG(extack, "Failed to load TC action module"); NL_SET_ERR_MSG(extack, "Failed to load TC action module");
err = -ENOENT; err = -ENOENT;
goto err_out; goto err_free;
} }
/* backward compatibility for policer */ /* backward compatibility for policer */
...@@ -1013,11 +1013,12 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, ...@@ -1013,11 +1013,12 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
err_mod: err_mod:
module_put(a_o->owner); module_put(a_o->owner);
err_out: err_free:
if (cookie) { if (cookie) {
kfree(cookie->data); kfree(cookie->data);
kfree(cookie); kfree(cookie);
} }
err_out:
return ERR_PTR(err); return ERR_PTR(err);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment