RDMA/hns: Replace kfree() with kvfree()
authorJiacheng Shi <billsjc@sjtu.edu.cn>
Fri, 10 Dec 2021 09:42:34 +0000 (01:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:25:55 +0000 (12:25 +0100)
commit579cefef7c425b99e6693f0f234f5be265aaf6e1
tree9b3f5a9fe6c04aa8f2e88c282324fe1b2874464b
parent7cf6466e00a77b0a914b7b2c28a1fc7947d55e59
RDMA/hns: Replace kfree() with kvfree()

[ Upstream commit 12d3bbdd6bd2780b71cc466f3fbc6eb7d43bbc2a ]

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: 6fd610c5733d ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_srq.c