Skip to contentSkip to conversation

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

PATCH New Gustavo A. R. Silva 1 participant 1 message Oct 6, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: broadcom: bcm4908_enet: use kcalloc() instead of kzalloc()

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

---
 drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bcm4908_enet.c +1 -1
index 02a569500234..a4726114be9e 100644
@@ -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;
 
Signature · 1 line
2.27.0