net/sched: act_api: stop loop over ops array on NULL in tcf_action_init
The ops array is contiguous, so stop processing whenever a NULL is found Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
a0e947c9cc
commit
e09ac779f7
@ -1506,10 +1506,8 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
|
||||
err:
|
||||
tcf_action_destroy(actions, flags & TCA_ACT_FLAGS_BIND);
|
||||
err_mod:
|
||||
for (i = 0; i < TCA_ACT_MAX_PRIO; i++) {
|
||||
if (ops[i])
|
||||
module_put(ops[i]->owner);
|
||||
}
|
||||
for (i = 0; i < TCA_ACT_MAX_PRIO && ops[i]; i++)
|
||||
module_put(ops[i]->owner);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user