Commit 12d3bbdd authored by Jiacheng Shi's avatar Jiacheng Shi Committed by Jason Gunthorpe

RDMA/hns: Replace kfree() with kvfree()

Variables allocated by kvmalloc_array() should not be freed by kfree.
Because they may be allocated by vmalloc.  So we replace kfree() with
kvfree() here.

Fixes: 6fd610c5 ("RDMA/hns: Support 0 hop addressing for SRQ buffer")
Link: https://lore.kernel.org/r/20211210094234.5829-1-billsjc@sjtu.edu.cnSigned-off-by: default avatarJiacheng Shi <billsjc@sjtu.edu.cn>
Acked-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent bee90911
...@@ -259,7 +259,7 @@ static int alloc_srq_wrid(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq) ...@@ -259,7 +259,7 @@ static int alloc_srq_wrid(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)
static void free_srq_wrid(struct hns_roce_srq *srq) static void free_srq_wrid(struct hns_roce_srq *srq)
{ {
kfree(srq->wrid); kvfree(srq->wrid);
srq->wrid = NULL; srq->wrid = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment