linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci()
@ 2023-03-31  7:03 Dan Carpenter
  2023-03-31 17:39 ` Simon Horman
  2023-04-03 18:05 ` Leon Romanovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-03-31  7:03 UTC (permalink / raw)
  To: Eli Cohen
  Cc: Leon Romanovsky, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Jacob Keller, Shay Drory, netdev, linux-rdma,
	kernel-janitors

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

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();
-- 
2.39.1


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

* Re: [PATCH net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci()
  2023-03-31  7:03 [PATCH net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci() Dan Carpenter
@ 2023-03-31 17:39 ` Simon Horman
  2023-04-03 18:05 ` Leon Romanovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-03-31 17:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Eli Cohen, Leon Romanovsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Jacob Keller, Shay Drory, netdev,
	linux-rdma, kernel-janitors

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>


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

* Re: [PATCH net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci()
  2023-03-31  7:03 [PATCH net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci() Dan Carpenter
  2023-03-31 17:39 ` Simon Horman
@ 2023-04-03 18:05 ` Leon Romanovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2023-04-03 18:05 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Eli Cohen, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Jacob Keller, Shay Drory, netdev, linux-rdma,
	kernel-janitors

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>

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

end of thread, other threads:[~2023-04-03 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  7:03 [PATCH net-next] net/mlx5: Fix check for allocation failure in comp_irqs_request_pci() Dan Carpenter
2023-03-31 17:39 ` Simon Horman
2023-04-03 18:05 ` Leon Romanovsky

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