]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/hns: Correct the value of srq_desc_size
authorWenpeng Liang <liangwenpeng@huawei.com>
Fri, 1 Nov 2019 02:33:30 +0000 (10:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:48:29 +0000 (08:48 +0100)
commit08f9495c6db349edac74c7e69f7c078596ca86d2
tree58f07c372e18565cda5a59473c36dfc05a606a57
parent43cb8b2eaaf7a062b9ec396e2fc15acd1125a999
RDMA/hns: Correct the value of srq_desc_size

[ Upstream commit 411c1e6774e2e1f96b1ccce4f119376b94ade3e4 ]

srq_desc_size should be rounded up to pow of two before used, or related
calculation may cause allocating wrong size of memory for srq buffer.

Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
Link: https://lore.kernel.org/r/1572575610-52530-3-git-send-email-liweihang@hisilicon.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_srq.c