* [PATCH] RDMA/bnxt_re: Fix an IS_ERR() vs NULL check
@ 2023-06-27 7:20 Dan Carpenter
2023-06-27 8:31 ` Selvin Xavier
2023-06-27 17:03 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-06-27 7:20 UTC (permalink / raw)
To: Selvin Xavier
Cc: Jason Gunthorpe, Leon Romanovsky, linux-rdma, kernel-janitors
The bnxt_re_mmap_entry_insert() function returns NULL, not error pointers.
Update the check for errors accordingly.
Fixes: 360da60d6c6e ("RDMA/bnxt_re: Enable low latency push")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index df757da95ac2..abef0b8baa7c 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -4213,8 +4213,8 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_ALLOC_PAGE)(struct uverbs_attr_bundle *
}
entry = bnxt_re_mmap_entry_insert(uctx, dbr, mmap_flag, &mmap_offset);
- if (IS_ERR(entry))
- return PTR_ERR(entry);
+ if (!entry)
+ return -ENOMEM;
uobj->object = entry;
uverbs_finalize_uobj_create(attrs, BNXT_RE_ALLOC_PAGE_HANDLE);
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/bnxt_re: Fix an IS_ERR() vs NULL check
2023-06-27 7:20 [PATCH] RDMA/bnxt_re: Fix an IS_ERR() vs NULL check Dan Carpenter
@ 2023-06-27 8:31 ` Selvin Xavier
2023-06-27 17:03 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Selvin Xavier @ 2023-06-27 8:31 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jason Gunthorpe, Leon Romanovsky, linux-rdma, kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]
On Tue, Jun 27, 2023 at 12:50 PM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> The bnxt_re_mmap_entry_insert() function returns NULL, not error pointers.
> Update the check for errors accordingly.
>
> Fixes: 360da60d6c6e ("RDMA/bnxt_re: Enable low latency push")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
> ---
> drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index df757da95ac2..abef0b8baa7c 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -4213,8 +4213,8 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_ALLOC_PAGE)(struct uverbs_attr_bundle *
> }
>
> entry = bnxt_re_mmap_entry_insert(uctx, dbr, mmap_flag, &mmap_offset);
> - if (IS_ERR(entry))
> - return PTR_ERR(entry);
> + if (!entry)
> + return -ENOMEM;
>
> uobj->object = entry;
> uverbs_finalize_uobj_create(attrs, BNXT_RE_ALLOC_PAGE_HANDLE);
> --
> 2.39.2
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/bnxt_re: Fix an IS_ERR() vs NULL check
2023-06-27 7:20 [PATCH] RDMA/bnxt_re: Fix an IS_ERR() vs NULL check Dan Carpenter
2023-06-27 8:31 ` Selvin Xavier
@ 2023-06-27 17:03 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2023-06-27 17:03 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Selvin Xavier, Leon Romanovsky, linux-rdma, kernel-janitors
On Tue, Jun 27, 2023 at 10:20:13AM +0300, Dan Carpenter wrote:
> The bnxt_re_mmap_entry_insert() function returns NULL, not error pointers.
> Update the check for errors accordingly.
>
> Fixes: 360da60d6c6e ("RDMA/bnxt_re: Enable low latency push")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
> ---
> drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-27 17:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27 7:20 [PATCH] RDMA/bnxt_re: Fix an IS_ERR() vs NULL check Dan Carpenter
2023-06-27 8:31 ` Selvin Xavier
2023-06-27 17:03 ` Jason Gunthorpe
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).