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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170418070219.GA14088@mtr-leonro.local>
Date:   Tue, 18 Apr 2017 10:02:19 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Greg Thelen <gthelen@...gle.com>
Cc:     Or Gerlitz <ogerlitz@...lanox.com>,
        Jack Morgenstein <jackm@....mellanox.co.il>,
        Matan Barak <matanb@...lanox.com>,
        Ido Shamay <idos@...lanox.com>,
        Yishai Hadas <yishaih@...lanox.com>,
        Amir Vadai <amirv@...lanox.com>,
        Roland Dreier <roland@...estorage.com>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        Tariq Toukan <tariqt@...lanox.com>
Subject: Re: [PATCH] net/mlx4: suppress 'may be used uninitialized' warning

On Mon, Apr 17, 2017 at 11:21:35PM -0700, Greg Thelen wrote:
> gcc 4.8.4 complains that mlx4_SW2HW_MPT_wrapper() uses an uninitialized
> 'mpt' variable:
>   drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'mlx4_SW2HW_MPT_wrapper':
>   drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2802:12: warning: 'mpt' may be used uninitialized in this function [-Wmaybe-uninitialized]
>      mpt->mtt = mtt;
>
> I think this warning is a false complaint.  mpt is only used when
> mr_res_start_move_to() return zero, and in all such cases it initializes
> mpt.
> But apparently gcc cannot see that.
>
> Initialize mpt to avoid the warning.
>
> Signed-off-by: Greg Thelen <gthelen@...gle.com>
> ---

It looks like other callers of mr_res_start_move_to() have the same
"uninitialized" variable.

Thanks

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ