PCI: mvebu: Use devm_kcalloc() to allocate an array
[linux-drm-fsl-dcu.git] / drivers / pci / host / pci-mvebu.c
index 00467c5a58ac5fcd43646e43aaabc934dd009f08..7282bb06c7a842c9befcae0e05b6a8b38fd6bcef 100644 (file)
@@ -1075,8 +1075,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
 
        num = of_get_available_child_count(pdev->dev.of_node);
 
-       pcie->ports = devm_kzalloc(&pdev->dev, num *
-                                  sizeof(struct mvebu_pcie_port),
+       pcie->ports = devm_kcalloc(&pdev->dev, num, sizeof(*pcie->ports),
                                   GFP_KERNEL);
        if (!pcie->ports)
                return -ENOMEM;