RDMA/ocrdma: Fix check for NULL instead of IS_ERR
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 2 May 2012 06:13:57 +0000 (09:13 +0300)
committerRoland Dreier <roland@purestorage.com>
Tue, 8 May 2012 18:17:49 +0000 (11:17 -0700)
The ocrdma_alloc_lkey() function never returns NULL pointers -- it
returns ERR_PTRs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

index eb55c80fa7d33f38de9d44f8ac75381b22a071d0..0d1872faa6ab3ab2351138150dba03f6123ef906 100644 (file)
@@ -486,8 +486,8 @@ struct ib_mr *ocrdma_get_dma_mr(struct ib_pd *ibpd, int acc)
        struct ocrdma_mr *mr;
 
        mr = ocrdma_alloc_lkey(ibpd, acc, 0, OCRDMA_ADDR_CHECK_DISABLE);
-       if (!mr)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(mr))
+               return ERR_CAST(mr);
 
        return &mr->ibmr;
 }