Commit d5972f10 authored by Dan Carpenter's avatar Dan Carpenter Committed by Saeed Mahameed

net/mlx5: Fix check for allocation failure in comp_irqs_request_pci()

This function accidentally dereferences "cpus" instead of returning
directly.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202305200354.KV3jU94w-lkp@intel.com/
Fixes: b48a0f72 ("net/mlx5: Refactor completion irq request/release code")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent fe5c2d3a
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment