diff options
author | Wenpeng Liang <liangwenpeng@huawei.com> | 2022-03-02 14:48:28 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2022-03-04 17:36:32 -0400 |
commit | 904de76c42b7d758e75197f8d532a1ffafc3caad (patch) | |
tree | e3ac110165bc1c5f46c706375c6eff47cb7783b4 /drivers/infiniband/hw/hns/hns_roce_hw_v2.c | |
parent | RDMA/hns: Remove similar code that configures the hardware contexts (diff) | |
download | linux-dev-904de76c42b7d758e75197f8d532a1ffafc3caad.tar.xz linux-dev-904de76c42b7d758e75197f8d532a1ffafc3caad.zip |
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 '')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 631f6e233492..06eb4f00428c 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -5981,8 +5981,8 @@ static int hns_roce_v2_create_eq(struct hns_roce_dev *hr_dev, /* Allocate mailbox memory */ mailbox = hns_roce_alloc_cmd_mailbox(hr_dev); - if (IS_ERR_OR_NULL(mailbox)) - return -ENOMEM; + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); ret = alloc_eq_buf(hr_dev, eq); if (ret) |