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-next>] [day] [month] [year] [list]
Date:   Fri, 29 May 2020 22:54:48 -0700
From:   Nathan Chancellor <>
To:     Saeed Mahameed <>,
        Leon Romanovsky <>
Cc:     "David S. Miller" <>,
        Jakub Kicinski <>,,, Parav Pandit <>,,,
        Nathan Chancellor <>
Subject: [PATCH net-next] mlx5: Restore err assignment in mlx5_mdev_init

Clang warns:

drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:6: warning: variable
'err' is used uninitialized whenever 'if' condition is true
        if (!priv->dbg_root) {
drivers/net/ethernet/mellanox/mlx5/core/main.c:1303:9: note:
uninitialized use occurs here
        return err;
drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:2: note: remove the
'if' if its condition is always false
        if (!priv->dbg_root) {
drivers/net/ethernet/mellanox/mlx5/core/main.c:1259:9: note: initialize
the variable 'err' to silence this warning
        int err;
                = 0
1 warning generated.

This path previously returned -ENOMEM, restore that error code so that
it is not uninitialized.

Fixes: 810cbb25549b ("net/mlx5: Add missing mutex destroy")
Signed-off-by: Nathan Chancellor <>
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index df46b1fce3a7..ac68445fde2d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1277,6 +1277,7 @@ static int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
 	if (!priv->dbg_root) {
 		dev_err(dev->device, "mlx5_core: error, Cannot create debugfs dir, aborting\n");
+		err = -ENOMEM;
 		goto err_dbg_root;

base-commit: c0cc73b79123e67b212bd537a7af88e52c9fbeac

Powered by blists - more mailing lists