Commit e09ac779 authored by Pedro Tammela's avatar Pedro Tammela Committed by Paolo Abeni

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: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent a0e947c9
......@@ -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;
}
......
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