diff options
author | Kees Cook <keescook@chromium.org> | 2018-10-05 16:21:46 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-10-05 18:06:30 -0700 |
commit | 329e09893909d409039f6a79757d9b80b67efe39 (patch) | |
tree | d83759b28dcc8760167ed7c082d5846f63a55d2d /drivers/pci | |
parent | 57361846b52bc686112da6ca5368d11210796804 (diff) | |
download | linux-329e09893909d409039f6a79757d9b80b67efe39.tar.gz linux-329e09893909d409039f6a79757d9b80b67efe39.tar.bz2 linux-329e09893909d409039f6a79757d9b80b67efe39.zip |
treewide: Replace more open-coded allocation size multiplications
As done treewide earlier, this catches several more open-coded
allocation size calculations that were added to the kernel during the
merge window. This performs the following mechanical transformations
using Coccinelle:
kvmalloc(a * b, ...) -> kvmalloc_array(a, b, ...)
kvzalloc(a * b, ...) -> kvcalloc(a, b, ...)
devm_kzalloc(..., a * b, ...) -> devm_kcalloc(..., a, b, ...)
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/controller/pcie-cadence.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/pcie-cadence.c b/drivers/pci/controller/pcie-cadence.c index 86f1b002c846..975bcdd6b5c0 100644 --- a/drivers/pci/controller/pcie-cadence.c +++ b/drivers/pci/controller/pcie-cadence.c @@ -180,11 +180,11 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie) return 0; } - phy = devm_kzalloc(dev, sizeof(*phy) * phy_count, GFP_KERNEL); + phy = devm_kcalloc(dev, phy_count, sizeof(*phy), GFP_KERNEL); if (!phy) return -ENOMEM; - link = devm_kzalloc(dev, sizeof(*link) * phy_count, GFP_KERNEL); + link = devm_kcalloc(dev, phy_count, sizeof(*link), GFP_KERNEL); if (!link) return -ENOMEM; |