diff mbox series

[net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci()

Message ID 6652003b-e89c-4011-9e7d-a730a50bcfce@kili.mountain (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers fail 1 blamed authors not CCed: saeedm@nvidia.com; 1 maintainers not CCed: saeedm@nvidia.com
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter March 31, 2023, 7:03 a.m. UTC
This function accidentally dereferences "cpus" instead of returning
directly.

Fixes: b48a0f72bc3e ("net/mlx5: Refactor completion irq request/release code")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman March 31, 2023, 5:39 p.m. UTC | #1
On Fri, Mar 31, 2023 at 10:03:47AM +0300, Dan Carpenter wrote:
> This function accidentally dereferences "cpus" instead of returning
> directly.
> 
> Fixes: b48a0f72bc3e ("net/mlx5: Refactor completion irq request/release code")
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Leon Romanovsky April 3, 2023, 6:05 p.m. UTC | #2
On Fri, Mar 31, 2023 at 10:03:47AM +0300, Dan Carpenter wrote:
> This function accidentally dereferences "cpus" instead of returning
> directly.
> 
> Fixes: b48a0f72bc3e ("net/mlx5: Refactor completion irq request/release code")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
index eb41f0abf798..13491246c9e9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
@@ -824,7 +824,7 @@  static int comp_irqs_request_pci(struct mlx5_core_dev *dev)
 	ncomp_eqs = table->num_comp_eqs;
 	cpus = kcalloc(ncomp_eqs, sizeof(*cpus), GFP_KERNEL);
 	if (!cpus)
-		ret = -ENOMEM;
+		return -ENOMEM;
 
 	i = 0;
 	rcu_read_lock();