Skip to content

Commit dc3bda6

Browse files
wenglianfarleon
authored andcommitted
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: c00743c ("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>
1 parent a942ec2 commit dc3bda6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/infiniband/hw/hns/hns_roce_hem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev,
281281
return hem;
282282

283283
fail:
284-
hns_roce_free_hem(hr_dev, hem);
284+
kfree(hem);
285285
return NULL;
286286
}
287287

0 commit comments

Comments
 (0)