RDMA/bnxt_re: checking for NULL instead of IS_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 10 Jul 2017 07:22:47 +0000 (10:22 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jul 2017 15:20:49 +0000 (11:20 -0400)
bnxt_re_alloc_mw() doesn't return NULL, it returns error pointers.

Fixes: 9152e0b722b2 ("RDMA/bnxt_re: HW workarounds for handling specific conditions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index c7bd68311d0c5317973ecf9c3fb8fce8fe8ffad4..e794b0fa4ae6509f80c3c48f4dd4a8f6f7c4b7a9 100644 (file)
@@ -588,10 +588,10 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
 
        /* Create a fence MW only for kernel consumers */
        mw = bnxt_re_alloc_mw(&pd->ib_pd, IB_MW_TYPE_1, NULL);
-       if (!mw) {
+       if (IS_ERR(mw)) {
                dev_err(rdev_to_dev(rdev),
                        "Failed to create fence-MW for PD: %p\n", pd);
-               rc = -EINVAL;
+               rc = PTR_ERR(mw);
                goto fail;
        }
        fence->mw = mw;