All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/mlx5: Fix a error code in devx_umem_reg_cmd_alloc()
@ 2020-11-27  7:43 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-11-27  7:43 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors

This code returns PTR_ERR(NULL) which is zero or success but it should
return -ENOMEM.

Fixes: 878f7b31c3a7 ("RDMA/mlx5: Use ib_umem_find_best_pgsz() for devx")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/hw/mlx5/devx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index 7c3eefba6197..0b87c74281d3 100644
--- a/drivers/infiniband/hw/mlx5/devx.c
+++ b/drivers/infiniband/hw/mlx5/devx.c
@@ -2107,7 +2107,7 @@ static int devx_umem_reg_cmd_alloc(struct mlx5_ib_dev *dev,
 		      ib_umem_num_dma_blocks(obj->umem, page_size));
 	cmd->in = uverbs_zalloc(attrs, cmd->inlen);
 	if (!cmd->in)
-		return PTR_ERR(cmd->in);
+		return -ENOMEM;
 
 	umem = MLX5_ADDR_OF(create_umem_in, cmd->in, umem);
 	mtt = (__be64 *)MLX5_ADDR_OF(umem, umem, mtt);
-- 
2.29.2

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

end of thread, other threads:[~2020-11-27 13:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-27  7:43 [PATCH] RDMA/mlx5: Fix a error code in devx_umem_reg_cmd_alloc() Dan Carpenter
2020-11-27  7:43 ` Dan Carpenter
2020-11-27 13:05 ` Jason Gunthorpe
2020-11-27 13:05   ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.