linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()
@ 2022-01-05 15:17 Jiapeng Chong
  2022-01-06  3:51 ` Saeed Mahameed
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2022-01-05 15:17 UTC (permalink / raw)
  To: saeedm
  Cc: leon, davem, kuba, netdev, linux-rdma, linux-kernel,
	Jiapeng Chong, Abaci Robot

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/mlx5/core/en/reporter_rx.c:91
mlx5e_rx_reporter_err_icosq_cqe_recover() warn: missing error code
'err'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
index 2684e9da9f41..ceb21573db6c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
@@ -87,8 +87,10 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx)
 		goto out;
 	}
 
-	if (state != MLX5_SQC_STATE_ERR)
+	if (state != MLX5_SQC_STATE_ERR) {
+		err = -EINVAL;
 		goto out;
+	}
 
 	mlx5e_deactivate_rq(rq);
 	if (xskrq)
-- 
2.20.1.7.g153144c


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

* Re: [PATCH] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()
  2022-01-05 15:17 [PATCH] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover() Jiapeng Chong
@ 2022-01-06  3:51 ` Saeed Mahameed
  0 siblings, 0 replies; 2+ messages in thread
From: Saeed Mahameed @ 2022-01-06  3:51 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: saeedm, leon, davem, kuba, netdev, linux-rdma, linux-kernel, Abaci Robot

On Wed, Jan 05, 2022 at 11:17:51PM +0800, 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/mlx5/core/en/reporter_rx.c:91
>mlx5e_rx_reporter_err_icosq_cqe_recover() warn: missing error code
>'err'.
>

error code is not missing, err is equal to 0 at this point and the 
code aborts with err = 0 as intended. False alarm. nack.



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

end of thread, other threads:[~2022-01-06  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 15:17 [PATCH] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover() Jiapeng Chong
2022-01-06  3:51 ` Saeed Mahameed

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).