Message ID | 20230227152352.266109-1-pctammela@mojatatu.com (mailing list archive) |
---|---|
State | Accepted |
Commit | fb07390463c95e6eef254044d6dde050bfb9807a |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] net/sched: act_connmark: handle errno on tcf_idr_check_alloc | expand |
On Mon, Feb 27, 2023 at 12:23:52PM -0300, Pedro Tammela wrote: > Smatch reports that 'ci' can be used uninitialized. > The current code ignores errno coming from tcf_idr_check_alloc, which > will lead to the incorrect usage of 'ci'. Handle the errno as it should. > > Fixes: 288864effe33 ("net/sched: act_connmark: transition to percpu stats and rcu") > Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> > Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Thanks Pedro, looks good to me. Reviewed-by: Simon Horman <simon.horman@corigine.com>
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Mon, 27 Feb 2023 12:23:52 -0300 you wrote: > Smatch reports that 'ci' can be used uninitialized. > The current code ignores errno coming from tcf_idr_check_alloc, which > will lead to the incorrect usage of 'ci'. Handle the errno as it should. > > Fixes: 288864effe33 ("net/sched: act_connmark: transition to percpu stats and rcu") > Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> > Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> > > [...] Here is the summary with links: - [net,v2] net/sched: act_connmark: handle errno on tcf_idr_check_alloc https://git.kernel.org/netdev/net/c/fb07390463c9 You are awesome, thank you!
diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 8dabfb52ea3d..0d7aee8933c5 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c @@ -158,6 +158,9 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla, nparms->zone = parm->zone; ret = 0; + } else { + err = ret; + goto out_free; } err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);