From: Dan Carpenter <dan.carpenter@linaro.org>
To: Konstantin Taranov <kotaranov@microsoft.com>
Cc: Long Li <longli@microsoft.com>,
Ajay Sharma <sharmaajay@microsoft.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
Shiraz Saleem <shirazsaleem@microsoft.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] RDMA/mana_ib: Fix error code in probe()
Date: Fri, 7 Feb 2025 12:16:03 +0300 [thread overview]
Message-ID: <2bbe900e-18b3-46b5-a08c-42eb71886da6@stanley.mountain> (raw)
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
next reply other threads:[~2025-02-07 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 9:16 Dan Carpenter [this message]
2025-02-07 17:26 ` [EXTERNAL] [PATCH next] RDMA/mana_ib: Fix error code in probe() Long Li
2025-02-09 9:24 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2bbe900e-18b3-46b5-a08c-42eb71886da6@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=kotaranov@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=sharmaajay@microsoft.com \
--cc=shirazsaleem@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox