net: broadcom: bcm4908_enet: use kcalloc() instead of kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 6 Oct 2021 18:08:43 +0000 (13:08 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Oct 2021 16:08:16 +0000 (09:08 -0700)
Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211006180843.GA913399@embeddedor
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bcm4908_enet.c

index aa3b5672eab20cce4ca8e3b7971e16afe1da41bd..7cc5213c575a1d40cc012d16a0feaf44c611c3cf 100644 (file)
@@ -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;