Commit a0b1b205 authored by Thierry Reding's avatar Thierry Reding Committed by David S. Miller
Browse files

net: stmmac: tegra: Properly allocate clock bulk data



The clock data is an array of struct clk_bulk_data, so make sure to
allocate enough memory.

Fixes: d8ca1137 ("net: stmmac: tegra: Add MGBE support")
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56c6be35
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -234,7 +234,8 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
	res.addr = mgbe->regs;
	res.irq = irq;

	mgbe->clks = devm_kzalloc(&pdev->dev, sizeof(*mgbe->clks), GFP_KERNEL);
	mgbe->clks = devm_kcalloc(&pdev->dev, ARRAY_SIZE(mgbe_clks),
				  sizeof(*mgbe->clks), GFP_KERNEL);
	if (!mgbe->clks)
		return -ENOMEM;