summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-02-12 11:22:33 +0000
committerJason Gunthorpe <jgg@mellanox.com>2019-02-13 09:00:43 -0700
commite8ac9389f0d7c74fd988a5ce77765588f74dacd2 (patch)
tree498f29817aac0cb620f94687da9c219d2df00ac3
parentd892273bb5b6fe2a3b5d2d147153e35b447e9041 (diff)
downloadlinux-e8ac9389f0d7c74fd988a5ce77765588f74dacd2.tar.bz2
RDMA: Fix allocation failure on pointer pd
The null check on an allocation failure on pd is currently checking if pd is non-null rather than null. Fix this by adding the missing ! operator. Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index c8c90072badd..97515c340134 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -745,7 +745,7 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
ibdev = &hr_dev->ib_dev;
pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
- if (pd)
+ if (!pd)
goto alloc_mem_failed;
pd->device = ibdev;