linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlx4: Fix missing error code in mlx4_load_one()
@ 2021-07-23 10:36 Jiapeng Chong
  2021-07-25  6:15 ` Tariq Toukan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-07-23 10:36 UTC (permalink / raw)
  To: tariqt; +Cc: davem, kuba, netdev, linux-rdma, linux-kernel, Jiapeng Chong

The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'err'.

Eliminate the follow smatch warning:

drivers/net/ethernet/mellanox/mlx4/main.c:3538 mlx4_load_one() warn:
missing error code 'err'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 7ae0e400cd93 ("net/mlx4_core: Flexible (asymmetric) allocation of
EQs and MSI-X vectors for PF/VFs")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 00c8465..28ac469 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -3535,6 +3535,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
 
 		if (!SRIOV_VALID_STATE(dev->flags)) {
 			mlx4_err(dev, "Invalid SRIOV state\n");
+			err = -EINVAL;
 			goto err_close;
 		}
 	}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mlx4: Fix missing error code in mlx4_load_one()
  2021-07-23 10:36 [PATCH] mlx4: Fix missing error code in mlx4_load_one() Jiapeng Chong
@ 2021-07-25  6:15 ` Tariq Toukan
  2021-07-25  8:37 ` Gal Pressman
  2021-07-25  9:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2021-07-25  6:15 UTC (permalink / raw)
  To: Jiapeng Chong, tariqt; +Cc: davem, kuba, netdev, linux-rdma, linux-kernel



On 7/23/2021 1:36 PM, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/mellanox/mlx4/main.c:3538 mlx4_load_one() warn:
> missing error code 'err'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 7ae0e400cd93 ("net/mlx4_core: Flexible (asymmetric) allocation of
> EQs and MSI-X vectors for PF/VFs")
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 00c8465..28ac469 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -3535,6 +3535,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
>   
>   		if (!SRIOV_VALID_STATE(dev->flags)) {
>   			mlx4_err(dev, "Invalid SRIOV state\n");
> +			err = -EINVAL;
>   			goto err_close;
>   		}
>   	}
> 

Thanks for you patch.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Regards,
Tariq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mlx4: Fix missing error code in mlx4_load_one()
  2021-07-23 10:36 [PATCH] mlx4: Fix missing error code in mlx4_load_one() Jiapeng Chong
  2021-07-25  6:15 ` Tariq Toukan
@ 2021-07-25  8:37 ` Gal Pressman
  2021-07-25  9:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Gal Pressman @ 2021-07-25  8:37 UTC (permalink / raw)
  To: Jiapeng Chong, tariqt; +Cc: davem, kuba, netdev, linux-rdma, linux-kernel

On 23/07/2021 13:36, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/mellanox/mlx4/main.c:3538 mlx4_load_one() warn:
> missing error code 'err'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 7ae0e400cd93 ("net/mlx4_core: Flexible (asymmetric) allocation of
> EQs and MSI-X vectors for PF/VFs")

Fixes line shouldn't be wrapped.

> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 00c8465..28ac469 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -3535,6 +3535,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
>  
>  		if (!SRIOV_VALID_STATE(dev->flags)) {
>  			mlx4_err(dev, "Invalid SRIOV state\n");
> +			err = -EINVAL;
>  			goto err_close;
>  		}
>  	}
> 

I think this patch is missing a few occurrences:
https://elixir.bootlin.com/linux/v5.14-rc2/source/drivers/net/ethernet/mellanox/mlx4/main.c#L3455
https://elixir.bootlin.com/linux/v5.14-rc2/source/drivers/net/ethernet/mellanox/mlx4/main.c#L3468
https://elixir.bootlin.com/linux/v5.14-rc2/source/drivers/net/ethernet/mellanox/mlx4/main.c#L3490

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mlx4: Fix missing error code in mlx4_load_one()
  2021-07-23 10:36 [PATCH] mlx4: Fix missing error code in mlx4_load_one() Jiapeng Chong
  2021-07-25  6:15 ` Tariq Toukan
  2021-07-25  8:37 ` Gal Pressman
@ 2021-07-25  9:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-25  9:50 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: tariqt, davem, kuba, netdev, linux-rdma, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Fri, 23 Jul 2021 18:36:09 +0800 you wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/mellanox/mlx4/main.c:3538 mlx4_load_one() warn:
> missing error code 'err'.
> 
> [...]

Here is the summary with links:
  - mlx4: Fix missing error code in mlx4_load_one()
    https://git.kernel.org/netdev/net/c/7e4960b3d66d

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-25  9:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23 10:36 [PATCH] mlx4: Fix missing error code in mlx4_load_one() Jiapeng Chong
2021-07-25  6:15 ` Tariq Toukan
2021-07-25  8:37 ` Gal Pressman
2021-07-25  9:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).