diff options
| author | Leon Romanovsky <[email protected]> | 2020-06-02 12:28:37 +0000 |
|---|---|---|
| committer | Saeed Mahameed <[email protected]> | 2020-06-11 22:38:06 +0000 |
| commit | 17e73d47cd095154878dfedd4918d6a9482eba13 (patch) | |
| tree | 4a48bc25c3a16069e11255f7eb9522996c43c770 /drivers/pci/controller/pci-host-generic.c | |
| parent | net/mlx5e: CT: Fix ipv6 nat header rewrite actions (diff) | |
| download | kernel-17e73d47cd095154878dfedd4918d6a9482eba13.tar.gz kernel-17e73d47cd095154878dfedd4918d6a9482eba13.zip | |
net/mlx5: Don't fail driver on failure to create debugfs
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.
The check of returned value of debugfs_create_dir() is wrong because
by the design debugfs failures should never fail the driver and the
check itself was wrong too. The kernel compiled without CONFIG_DEBUG_FS
will return ERR_PTR(-ENODEV) and not NULL as expected.
Fixes: 11f3b84d7068 ("net/mlx5: Split mdev init and pci init")
Link: https://github.com/ClangBuiltLinux/linux/issues/1042
Reported-by: Nathan Chancellor <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
Diffstat (limited to 'drivers/pci/controller/pci-host-generic.c')
0 files changed, 0 insertions, 0 deletions
