aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYixian Liu <liuyixian@huawei.com>2018-03-19 21:36:07 +0800
committerJason Gunthorpe <jgg@mellanox.com>2018-03-19 11:41:41 -0600
commitdf7e40425813c50cd252e6f5e348a81ef1acae56 (patch)
tree530543104e02673f36b535e31ecec762e912bf0a
parentIB/core: Remove unimplemented ib_peek_cq (diff)
downloadlinux-dev-df7e40425813c50cd252e6f5e348a81ef1acae56.tar.xz
linux-dev-df7e40425813c50cd252e6f5e348a81ef1acae56.zip
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: Dan Carpenter <dan.carpenter@oracle.com> Fixes: e088a685eae9 ("RDMA/hns: Support rq record doorbell for the user space") Signed-off-by: Yixian Liu <liuyixian@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index e1ee6666f790..6e48b1f507cf 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -338,7 +338,7 @@ static struct ib_ucontext *hns_roce_alloc_ucontext(struct ib_device *ib_dev,
{
int ret = 0;
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);
resp.qp_tab_size = hr_dev->caps.num_qps;