Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df7e4042 authored by Yixian Liu's avatar Yixian Liu Committed by Jason Gunthorpe
Browse files

RDMA/hns: Fix init resp when alloc ucontext



The data in resp will be copied from kernel to userspace, thus it needs to
be initialized to zeros to avoid copying uninited stack memory.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: e088a685 ("RDMA/hns: Support rq record doorbell for the user space")
Signed-off-by: default avatarYixian Liu <liuyixian@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent b19744e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -338,7 +338,7 @@ static struct ib_ucontext *hns_roce_alloc_ucontext(struct ib_device *ib_dev,
{
{
	int ret = 0;
	int ret = 0;
	struct hns_roce_ucontext *context;
	struct hns_roce_ucontext *context;
	struct hns_roce_ib_alloc_ucontext_resp resp;
	struct hns_roce_ib_alloc_ucontext_resp resp = {};
	struct hns_roce_dev *hr_dev = to_hr_dev(ib_dev);
	struct hns_roce_dev *hr_dev = to_hr_dev(ib_dev);


	resp.qp_tab_size = hr_dev->caps.num_qps;
	resp.qp_tab_size = hr_dev->caps.num_qps;