diff options
author | wenglianfa <wenglianfa@huawei.com> | 2024-04-12 12:16:12 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2024-04-16 15:06:47 +0300 |
commit | dc3bda6e568e9310b7cd07769dd70a3f0cd696ca (patch) | |
tree | 9eccc376e8757a420e5df91f5e63dc911abce4c2 /drivers/infiniband/hw | |
parent | a942ec2745ca864cd8512142100e4027dc306a42 (diff) | |
download | linux-dc3bda6e568e9310b7cd07769dd70a3f0cd696ca.tar.xz |
RDMA/hns: Fix mismatch exception rollback
When dma_alloc_coherent() fails in hns_roce_alloc_hem(), just call
kfree() to release hem instead of hns_roce_free_hem().
Fixes: c00743cbf2b8 ("RDMA/hns: Simplify 'struct hns_roce_hem' allocation")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20240412091616.370789-7-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index a9ea55506779..1c2ec803e030 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -281,7 +281,7 @@ static struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev, return hem; fail: - hns_roce_free_hem(hr_dev, hem); + kfree(hem); return NULL; } |