[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240227193932.7762464d@kernel.org>
Date: Tue, 27 Feb 2024 19:39:32 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
<netdev@...r.kernel.org>, Ido Schimmel <idosch@...dia.com>, "David Ahern"
<dsahern@...nel.org>, <mlxsw@...dia.com>, "Gustavo A . R . Silva"
<gustavoars@...nel.org>, Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH net-next 7/7] net: nexthop: Expose nexthop group HW
stats to user space
On Tue, 27 Feb 2024 19:17:32 +0100 Petr Machata wrote:
> + if (nla_put_u32(skb, NHA_HW_STATS_ENABLE, nhg->hw_stats))
> + goto nla_put_failure;
> +
> + if (op_flags & NHA_OP_FLAG_DUMP_HW_STATS &&
> + nhg->hw_stats) {
> + err = nh_grp_hw_stats_update(nh, &hw_stats_used);
> + if (err)
> + goto hw_stats_update_fail;
> +
> + if (nla_put_u32(skb, NHA_HW_STATS_USED, hw_stats_used))
> + goto nla_put_failure;
Something's off with the jump targets here.
clang detects nest is not initialized and you'll try to cancel it
> + }
> +
> nest = nla_nest_start(skb, NHA_GROUP_STATS);
> if (!nest)
> return -EMSGSIZE;
>
> for (i = 0; i < nhg->num_nh; i++)
> - if (nla_put_nh_group_stats_entry(skb, &nhg->nh_entries[i]))
> + if (nla_put_nh_group_stats_entry(skb, &nhg->nh_entries[i],
> + op_flags))
> goto nla_put_failure;
>
> nla_nest_end(skb, nest);
> return 0;
>
> nla_put_failure:
> + err = -EMSGSIZE;
> +hw_stats_update_fail:
> nla_nest_cancel(skb, nest);
> - return -EMSGSIZE;
> + return err;
--
pw-bot: cr
Powered by blists - more mailing lists