提交 08eb3018 编写于 作者: W Wei Hu(Xavier) 提交者: Doug Ledford

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: NWei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 3958cc56
...@@ -563,6 +563,8 @@ int hns_roce_table_get(struct hns_roce_dev *hr_dev, ...@@ -563,6 +563,8 @@ int hns_roce_table_get(struct hns_roce_dev *hr_dev,
/* Set HEM base address(128K/page, pa) to Hardware */ /* Set HEM base address(128K/page, pa) to Hardware */
if (hns_roce_set_hem(hr_dev, table, obj)) { if (hns_roce_set_hem(hr_dev, table, obj)) {
hns_roce_free_hem(hr_dev, table->hem[i]);
table->hem[i] = NULL;
ret = -ENODEV; ret = -ENODEV;
dev_err(dev, "set HEM base address to HW failed.\n"); dev_err(dev, "set HEM base address to HW failed.\n");
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册