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: d8ca113724
("net: stmmac: tegra: Add MGBE support")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
56c6be35fc
commit
a0b1b2055b
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue