From: Saeed Mahameed <saeedm@mellanox.com>
To: "natechancellor@gmail.com" <natechancellor@gmail.com>,
"leon@kernel.org" <leon@kernel.org>
Cc: "clang-built-linux@googlegroups.com"
<clang-built-linux@googlegroups.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net/mlx5e: Don't use err uninitialized in mlx5e_attach_decap
Date: Wed, 27 May 2020 16:28:58 +0000 [thread overview]
Message-ID: <df7438fed1ee6a2829a3745068f0938a6f159fdf.camel@mellanox.com> (raw)
In-Reply-To: <20200527075021.3457912-1-natechancellor@gmail.com>
On Wed, 2020-05-27 at 00:50 -0700, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3712:6: warning:
> variable 'err' is used uninitialized whenever 'if' condition is false
> [-Wsometimes-uninitialized]
> if (IS_ERR(d->pkt_reformat)) {
> ^~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3718:6: note:
> uninitialized use occurs here
> if (err)
> ^~~
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3712:2: note: remove
> the
> 'if' if its condition is always true
> if (IS_ERR(d->pkt_reformat)) {
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3670:9: note:
> initialize
> the variable 'err' to silence this warning
> int err;
> ^
> = 0
> 1 warning generated.
>
> It is not wrong, err is only ever initialized in if statements but
> this
> one is not in one. Initialize err to 0 to fix this.
>
> Fixes: 14e6b038afa0 ("net/mlx5e: Add support for hw decapsulation of
> MPLS over UDP")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1037
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
Applied to net-next-mlx5, will send shortly to net-next
Thanks,
Saeed.
prev parent reply other threads:[~2020-05-27 16:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 7:50 [PATCH] net/mlx5e: Don't use err uninitialized in mlx5e_attach_decap Nathan Chancellor
2020-05-27 16:28 ` Saeed Mahameed [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=df7438fed1ee6a2829a3745068f0938a6f159fdf.camel@mellanox.com \
--to=saeedm@mellanox.com \
--cc=clang-built-linux@googlegroups.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).