aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeihang Li <[email protected]>2020-03-20 11:23:34 +0800
committerJason Gunthorpe <[email protected]>2020-03-26 16:52:27 -0300
commit30d41e18c3a6eac39b7348ae7e3388f0ec7e680e (patch)
tree2db98f7efb981e8d64266ebe31e2c532fb91e2ca
parentae1c61489c7fa02f32cc45464dfb5612fa812b32 (diff)
RDMA/hns: Fix a wrong judgment of return value
hns_roce_alloc_mtt_range() never return -1, ret should be checked whether it is zero instead of -1. Fixes: 1ceb0b11a8a2 ("RDMA/hns: Fix non-standard error codes") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Weihang Li <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_mr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index b9898e71655a..176f34692f88 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -243,7 +243,7 @@ int hns_roce_mtt_init(struct hns_roce_dev *hr_dev, int npages, int page_shift,
/* Allocate MTT entry */
ret = hns_roce_alloc_mtt_range(hr_dev, mtt->order, &mtt->first_seg,
mtt->mtt_type);
- if (ret == -1)
+ if (ret)
return -ENOMEM;
return 0;