Skip to content

Commit 19fdb80

Browse files
Russell Kingbjorn-helgaas
authored andcommitted
PCI: mvebu: Use devm_kcalloc() to allocate an array
Rather than using devm_kzalloc() and multiplying the element and number, use the provided devm_kcalloc() helper for this. Tested-by: Willy Tarreau <[email protected]> (Iomega iConnect Kirkwood, MiraBox Armada 370) Tested-by: Andrew Lunn <[email protected]> (D-Link DIR664 Kirkwood) Tested-by: Thomas Petazzoni <[email protected]> (Armada XP GP) Signed-off-by: Russell King <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Thomas Petazzoni <[email protected]>
1 parent 4a2eae2 commit 19fdb80

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/pci/host/pci-mvebu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
10751075

10761076
num = of_get_available_child_count(pdev->dev.of_node);
10771077

1078-
pcie->ports = devm_kzalloc(&pdev->dev, num *
1079-
sizeof(struct mvebu_pcie_port),
1078+
pcie->ports = devm_kcalloc(&pdev->dev, num, sizeof(*pcie->ports),
10801079
GFP_KERNEL);
10811080
if (!pcie->ports)
10821081
return -ENOMEM;

0 commit comments

Comments
 (0)