summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/hns/hns_roce_mr.c
diff options
context:
space:
mode:
authorWenpeng Liang <liangwenpeng@huawei.com>2022-03-02 14:48:28 +0800
committerJason Gunthorpe <jgg@nvidia.com>2022-03-04 17:36:32 -0400
commit904de76c42b7d758e75197f8d532a1ffafc3caad (patch)
treee3ac110165bc1c5f46c706375c6eff47cb7783b4 /drivers/infiniband/hw/hns/hns_roce_mr.c
parentcf7f8f5c1c541ece6ec265432c8cf22a6edf067b (diff)
RDMA/hns: Clean up the return value check of hns_roce_alloc_cmd_mailbox()
hns_roce_alloc_cmd_mailbox() never returns NULL, so the check should be IS_ERR(). And the error code should be converted as the function's return value. Link: https://lore.kernel.org/r/20220302064830.61706-8-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_mr.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_mr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index 39de862666d7..b58b869339cc 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -148,10 +148,8 @@ static int hns_roce_mr_enable(struct hns_roce_dev *hr_dev,
/* Allocate mailbox memory */
mailbox = hns_roce_alloc_cmd_mailbox(hr_dev);
- if (IS_ERR(mailbox)) {
- ret = PTR_ERR(mailbox);
- return ret;
- }
+ if (IS_ERR(mailbox))
+ return PTR_ERR(mailbox);
if (mr->type != MR_TYPE_FRMR)
ret = hr_dev->hw->write_mtpt(hr_dev, mailbox->buf, mr);