diff options
author | Yixian Liu <liuyixian@huawei.com> | 2019-02-03 09:13:05 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-02-14 21:20:19 +0100 |
commit | f7f27a5f03cc9f47cc14f75a5be25f0f26b1b5ff (patch) | |
tree | 80c794874bd3ad2653d867bad2efefb91e22ddd0 /drivers/infiniband/hw/hns | |
parent | RDMA/hns: Fix the state of rereg mr (diff) | |
download | linux-f7f27a5f03cc9f47cc14f75a5be25f0f26b1b5ff.tar.xz linux-f7f27a5f03cc9f47cc14f75a5be25f0f26b1b5ff.zip |
RDMA/hns: Set allocated memory to zero for wrid
The memory allocated for wrid should be initialized to zero.
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hns')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_qp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index 51ca22b9f960..728ad8b6de2f 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -763,10 +763,10 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, goto err_mtt; } - hr_qp->sq.wrid = kmalloc_array(hr_qp->sq.wqe_cnt, sizeof(u64), - GFP_KERNEL); - hr_qp->rq.wrid = kmalloc_array(hr_qp->rq.wqe_cnt, sizeof(u64), - GFP_KERNEL); + hr_qp->sq.wrid = kcalloc(hr_qp->sq.wqe_cnt, sizeof(u64), + GFP_KERNEL); + hr_qp->rq.wrid = kcalloc(hr_qp->rq.wqe_cnt, sizeof(u64), + GFP_KERNEL); if (!hr_qp->sq.wrid || !hr_qp->rq.wrid) { ret = -ENOMEM; goto err_wrid; |