lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 27 May 2020 16:28:58 +0000
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "natechancellor@...il.com" <natechancellor@...il.com>,
        "leon@...nel.org" <leon@...nel.org>
CC:     "clang-built-linux@...glegroups.com" 
        <clang-built-linux@...glegroups.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net/mlx5e: Don't use err uninitialized in
 mlx5e_attach_decap

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@...il.com>
> ---

Applied to net-next-mlx5, will send shortly to net-next

Thanks,
Saeed.

Powered by blists - more mailing lists