]> git.dujemihanovic.xyz Git - linux.git/commitdiff
net/sched: act_connmark: handle errno on tcf_idr_check_alloc
authorPedro Tammela <pctammela@mojatatu.com>
Mon, 27 Feb 2023 15:23:52 +0000 (12:23 -0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Mar 2023 08:19:09 +0000 (08:19 +0000)
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>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_connmark.c

index 8dabfb52ea3db383e5172ab07e18792fa3d91341..0d7aee8933c5ffdc5acdb78138a9725ef63824f5 100644 (file)
@@ -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);