Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH next] RDMA/mana_ib: Fix error code in probe()
@ 2025-02-07  9:16 Dan Carpenter
  2025-02-07 17:26 ` [EXTERNAL] " Long Li
  2025-02-09  9:24 ` Leon Romanovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-02-07  9:16 UTC (permalink / raw)
  To: Konstantin Taranov
  Cc: Long Li, Ajay Sharma, Jason Gunthorpe, Leon Romanovsky,
	Shiraz Saleem, linux-rdma, linux-kernel, kernel-janitors

Return -ENOMEM if dma_pool_create() fails.  Don't return success.

Fixes: df91c470d9e5 ("RDMA/mana_ib: create/destroy AH")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/infiniband/hw/mana/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
index 0a7553f819ba..a17e7a6b0545 100644
--- a/drivers/infiniband/hw/mana/device.c
+++ b/drivers/infiniband/hw/mana/device.c
@@ -144,8 +144,10 @@ static int mana_ib_probe(struct auxiliary_device *adev,
 
 	dev->av_pool = dma_pool_create("mana_ib_av", mdev->gdma_context->dev,
 				       MANA_AV_BUFFER_SIZE, MANA_AV_BUFFER_SIZE, 0);
-	if (!dev->av_pool)
+	if (!dev->av_pool) {
+		ret = -ENOMEM;
 		goto destroy_rnic;
+	}
 
 	ret = ib_register_device(&dev->ib_dev, "mana_%d",
 				 mdev->gdma_context->dev);
-- 
2.47.2


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

end of thread, other threads:[~2025-02-09  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07  9:16 [PATCH next] RDMA/mana_ib: Fix error code in probe() Dan Carpenter
2025-02-07 17:26 ` [EXTERNAL] " Long Li
2025-02-09  9:24 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox