* [PATCH] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq()
@ 2024-01-08 9:06 Dan Carpenter
2024-01-08 9:44 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2024-01-08 9:06 UTC (permalink / raw)
To: Selvin Xavier
Cc: Jason Gunthorpe, Leon Romanovsky, linux-rdma, linux-kernel,
kernel-janitors
Return -ENOMEM if get_zeroed_page() fails. Don't return success.
Fixes: e275919d9669 ("RDMA/bnxt_re: Share a page to expose per CQ info with userspace")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 7213dc7574d0..824349659d69 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -2944,9 +2944,9 @@ int bnxt_re_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
struct bnxt_qplib_dev_attr *dev_attr = &rdev->dev_attr;
struct bnxt_qplib_chip_ctx *cctx;
struct bnxt_qplib_nq *nq = NULL;
- int rc = -ENOMEM, entries;
unsigned int nq_alloc_cnt;
int cqe = attr->cqe;
+ int rc, entries;
u32 active_cqs;
if (attr->flags)
@@ -3027,8 +3027,10 @@ int bnxt_re_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
hash_add(rdev->cq_hash, &cq->hash_entry, cq->qplib_cq.id);
/* Allocate a page */
cq->uctx_cq_page = (void *)get_zeroed_page(GFP_KERNEL);
- if (!cq->uctx_cq_page)
+ if (!cq->uctx_cq_page) {
+ rc = -ENOMEM;
goto c2fail;
+ }
resp.comp_mask |= BNXT_RE_CQ_TOGGLE_PAGE_SUPPORT;
}
resp.cqid = cq->qplib_cq.id;
--
2.42.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq()
2024-01-08 9:06 [PATCH] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq() Dan Carpenter
@ 2024-01-08 9:44 ` Leon Romanovsky
2024-01-08 10:03 ` Selvin Xavier
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2024-01-08 9:44 UTC (permalink / raw)
To: Selvin Xavier, Dan Carpenter
Cc: Jason Gunthorpe, linux-rdma, linux-kernel, kernel-janitors
On Mon, 08 Jan 2024 12:06:11 +0300, Dan Carpenter wrote:
> Return -ENOMEM if get_zeroed_page() fails. Don't return success.
>
>
Applied, thanks!
[1/1] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq()
https://git.kernel.org/rdma/rdma/c/abdde500cdf456
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq()
2024-01-08 9:44 ` Leon Romanovsky
@ 2024-01-08 10:03 ` Selvin Xavier
0 siblings, 0 replies; 3+ messages in thread
From: Selvin Xavier @ 2024-01-08 10:03 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Dan Carpenter, Jason Gunthorpe, linux-rdma, linux-kernel,
kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
On Mon, Jan 8, 2024 at 3:14 PM Leon Romanovsky <leon@kernel.org> wrote:
>
>
> On Mon, 08 Jan 2024 12:06:11 +0300, Dan Carpenter wrote:
> > Return -ENOMEM if get_zeroed_page() fails. Don't return success.
> >
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
> >
>
> Applied, thanks!
>
> [1/1] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq()
> https://git.kernel.org/rdma/rdma/c/abdde500cdf456
>
> Best regards,
> --
> Leon Romanovsky <leon@kernel.org>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-08 10:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 9:06 [PATCH] RDMA/bnxt_re: Fix error code in bnxt_re_create_cq() Dan Carpenter
2024-01-08 9:44 ` Leon Romanovsky
2024-01-08 10:03 ` Selvin Xavier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®