]> Git Repo - linux.git/commitdiff
RDMA/bnxt_re: Fix an IS_ERR() vs NULL check
authorDan Carpenter <[email protected]>
Tue, 27 Jun 2023 07:20:13 +0000 (10:20 +0300)
committerJason Gunthorpe <[email protected]>
Tue, 27 Jun 2023 17:02:43 +0000 (14:02 -0300)
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")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Selvin Xavier <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index a936e0d474f9ba1460c4405762b04081713f5c5c..ef47c32a53cb514b387e33da33df53eab89072a3 100644 (file)
@@ -4214,8 +4214,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);
This page took 0.06375 seconds and 4 git commands to generate.