summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/hns
diff options
context:
space:
mode:
authorWei Hu(Xavier) <xavier.huwei@huawei.com>2017-08-30 12:23:16 +0300
committerDoug Ledford <dledford@redhat.com>2017-09-27 15:34:56 +0300
commit08eb3018b6d91e0736cffba0a9a8c9aa1d2eb743 (patch)
treeff5e3eadbe6882d78b7b1268ff574792482a1028 /drivers/infiniband/hw/hns
parent3958cc564e1c5b97ddff7e12f95811a993a936e2 (diff)
downloadlinux-08eb3018b6d91e0736cffba0a9a8c9aa1d2eb743.tar.xz
RDMA/hns: Add releasing resource operation in error branch
This patch adds releasing resource operation in error branch of the function named hns_roce_table_get. Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hns')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c
index 8a3e174f5b5f..125e26ebf250 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hem.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hem.c
@@ -563,6 +563,8 @@ int hns_roce_table_get(struct hns_roce_dev *hr_dev,
/* Set HEM base address(128K/page, pa) to Hardware */
if (hns_roce_set_hem(hr_dev, table, obj)) {
+ hns_roce_free_hem(hr_dev, table->hem[i]);
+ table->hem[i] = NULL;
ret = -ENODEV;
dev_err(dev, "set HEM base address to HW failed.\n");
goto out;