summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-05-02 09:13:57 +0300
committerRoland Dreier <roland@purestorage.com>2012-05-08 11:17:49 -0700
commit55a8d62a3bd2a0536d526da817fd4f49e6470770 (patch)
tree3462e6a0fe6833b9e85b891ef6c5ead5f097bbe5
parent3e4d60a82e7ab4cd6e212b6834c6a48c79731957 (diff)
downloadlinux-3.10-55a8d62a3bd2a0536d526da817fd4f49e6470770.tar.gz
linux-3.10-55a8d62a3bd2a0536d526da817fd4f49e6470770.tar.bz2
linux-3.10-55a8d62a3bd2a0536d526da817fd4f49e6470770.zip
RDMA/ocrdma: Fix check for NULL instead of IS_ERR
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>
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_verbs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index eb55c80fa7d..0d1872faa6a 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -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;
}