提交 2b8a0f15 编写于 作者: G Gustavo A. R. Silva 提交者: Jakub Kicinski

net: broadcom: bcm4908_enet: use kcalloc() instead of kzalloc()

Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211006180843.GA913399@embeddedorSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 44cc24b0
......@@ -170,7 +170,7 @@ static int bcm4908_dma_alloc_buf_descs(struct bcm4908_enet *enet,
goto err_free_buf_descs;
}
ring->slots = kzalloc(ring->length * sizeof(*ring->slots), GFP_KERNEL);
ring->slots = kcalloc(ring->length, sizeof(*ring->slots), GFP_KERNEL);
if (!ring->slots)
goto err_free_buf_descs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册