Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 [-Wsometimes-uninitialized] 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: 810cbb2 ("net/mlx5: Add missing mutex destroy") Link: ClangBuiltLinux#1042 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
- Loading branch information