Skip to content

Commit 12d3bbd

Browse files
shijc-sjtujgunthorpe
authored andcommitted
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: 6fd610c ("RDMA/hns: Support 0 hop addressing for SRQ buffer") Link: https://lore.kernel.org/r/20211210094234.5829-1-billsjc@sjtu.edu.cn Signed-off-by: Jiacheng Shi <billsjc@sjtu.edu.cn> Acked-by: Wenpeng Liang <liangwenpeng@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent bee9091 commit 12d3bbd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/infiniband/hw/hns/hns_roce_srq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static int alloc_srq_wrid(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)
259259

260260
static void free_srq_wrid(struct hns_roce_srq *srq)
261261
{
262-
kfree(srq->wrid);
262+
kvfree(srq->wrid);
263263
srq->wrid = NULL;
264264
}
265265

0 commit comments

Comments
 (0)