提交 1a9ecf8d 编写于 作者: B Bryan Tan 提交者: Jason Gunthorpe

RDMA/vmw_pvrdma: Use more specific sizeof in kcalloc

Convert the sizeof(void *) in two kcalloc calls to be more
specific for the arrays that are being allocated.
Reviewed-by: NAdit Ranadive <aditr@vmware.com>
Reviewed-by: NAditya Sarwade <asarwade@vmware.com>
Reviewed-by: NJorgen Hansen <jhansen@vmware.com>
Signed-off-by: NBryan Tan <bryantan@vmware.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 5aef7cf2
...@@ -243,13 +243,13 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) ...@@ -243,13 +243,13 @@ static int pvrdma_register_device(struct pvrdma_dev *dev)
mutex_init(&dev->port_mutex); mutex_init(&dev->port_mutex);
spin_lock_init(&dev->desc_lock); spin_lock_init(&dev->desc_lock);
dev->cq_tbl = kcalloc(dev->dsr->caps.max_cq, sizeof(void *), dev->cq_tbl = kcalloc(dev->dsr->caps.max_cq, sizeof(struct pvrdma_cq *),
GFP_KERNEL); GFP_KERNEL);
if (!dev->cq_tbl) if (!dev->cq_tbl)
return ret; return ret;
spin_lock_init(&dev->cq_tbl_lock); spin_lock_init(&dev->cq_tbl_lock);
dev->qp_tbl = kcalloc(dev->dsr->caps.max_qp, sizeof(void *), dev->qp_tbl = kcalloc(dev->dsr->caps.max_qp, sizeof(struct pvrdma_qp *),
GFP_KERNEL); GFP_KERNEL);
if (!dev->qp_tbl) if (!dev->qp_tbl)
goto err_cq_free; goto err_cq_free;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册