[PATCH net-next] net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()

Subsystems: mellanox mlx5 core vpi driver, networking drivers, the rest

STALE2001d

3 messages, 3 authors, 2021-02-11 · open the first message on its own page

[PATCH net-next] net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()

From: Wei Yongjun <hidden>
Date: 2021-02-10 07:48:50

Fix to return negative error code -ENOMEM from the ioremap() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 .../net/ethernet/mellanox/mlx5/core/sf/dev/driver.c  | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
index daf63a8115e0..c4bf555c25ea 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
@@ -37,6 +37,7 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia
 	mdev->iseg = ioremap(mdev->iseg_base, sizeof(*mdev->iseg));
 	if (!mdev->iseg) {
 		mlx5_core_warn(mdev, "remap error\n");
+		err = -ENOMEM;
 		goto remap_err;
 	}
 

Re: [PATCH net-next] net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()

From: Leon Romanovsky <leon@kernel.org>
Date: 2021-02-10 08:04:38

On Wed, Feb 10, 2021 at 07:54:17AM +0000, Wei Yongjun wrote:
Fix to return negative error code -ENOMEM from the ioremap() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 .../net/ethernet/mellanox/mlx5/core/sf/dev/driver.c  | 1 +
 1 file changed, 1 insertion(+)
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

Re: [PATCH net-next] net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()

From: Saeed Mahameed <saeed@kernel.org>
Date: 2021-02-11 04:18:20

On Wed, 2021-02-10 at 10:03 +0200, Leon Romanovsky wrote:
On Wed, Feb 10, 2021 at 07:54:17AM +0000, Wei Yongjun wrote:
quoted
Fix to return negative error code -ENOMEM from the ioremap() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 .../net/ethernet/mellanox/mlx5/core/sf/dev/driver.c  | 1 +
 1 file changed, 1 insertion(+)
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Applied to net-next-mlx5,
Thanks!

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help