net: stmmac: tegra: Properly allocate clock bulk data
Subsystems (5)
PATCH 1/1 net: stmmac: tegra: Properly allocate clock bulk data
From: Thierry Reding <[email protected]>
The clock data is an array of struct clk_bulk_data, so make sure to allocate enough memory.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +2 -1
@@ -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 ;
Signature · 1 line
2.41.0
Quoted 1 line · Thierry Reding
From: Thierry Reding <[email protected]>
+ Revanth Kumar Uppala <[email protected]>,
Bhadram Varka <[email protected]>,
Maxime Coquelin <[email protected]>,
[email protected],
[email protected]
As per the output of
./scripts/get_maintainer.pl --git-min-percent 25 this.patch which is the preferred method to determine the CC list for Networking patches.
Quoted 5 lines
The clock data is an array of struct
clk_bulk_data, so make sure to allocate enough memory.Fixes d8ca113724e7 ("net: stmmac: tegra: Add MGBE support")Signed-off-by Thierry Reding <[email protected]>
Quoted 22 lines
--- drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +2
-1@@ -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 ;Signature · 1 line
2.41.0
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 9 lines · On Wed, 26 Jul 2023 18:32:00 +0200 you wrote:
From: Thierry Reding <[email protected]>
The clock data is an array of struct
clk_bulk_data, so make sure to allocate enough memory.Fixes d8ca113724e7 ("net: stmmac: tegra: Add MGBE support")Signed-off-by Thierry Reding <[email protected]>[...]
Here is the summary with links:
- net: stmmac: tegra: Properly allocate clock bulk data
https://git.kernel.org/netdev/net/c/a0b1b2055be3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html