diff mbox series

net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

Message ID 20220105151751.40723-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 3 maintainers not CCed: roid@nvidia.com ayal@nvidia.com tariqt@nvidia.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiapeng Chong Jan. 5, 2022, 3:17 p.m. UTC
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(-)

Comments

Saeed Mahameed Jan. 6, 2022, 3:51 a.m. UTC | #1
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.
diff mbox series

Patch

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)