diff mbox series

net: stmmac: tegra: Properly allocate clock bulk data

Message ID 20230726163200.2138394-1-thierry.reding@gmail.com (mailing list archive)
State Accepted
Commit a0b1b2055be34c0ec1371764d040164cde1ead79
Delegated to: Netdev Maintainers
Headers show
Series net: stmmac: tegra: Properly allocate clock bulk data | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1342 this patch: 1342
netdev/cc_maintainers fail 2 blamed authors not CCed: ruppala@nvidia.com vbhadram@nvidia.com; 5 maintainers not CCed: vbhadram@nvidia.com mcoquelin.stm32@gmail.com linux-arm-kernel@lists.infradead.org ruppala@nvidia.com linux-stm32@st-md-mailman.stormreply.com
netdev/build_clang success Errors and warnings before: 1365 this patch: 1365
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1365 this patch: 1365
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Thierry Reding July 26, 2023, 4:32 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

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 <treding@nvidia.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Horman July 27, 2023, 11:49 a.m. UTC | #1
On Wed, Jul 26, 2023 at 06:32:00PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>

+  Revanth Kumar Uppala <ruppala@nvidia.com>,
   Bhadram Varka <vbhadram@nvidia.com>,
   Maxime Coquelin <mcoquelin.stm32@gmail.com>,
   linux-arm-kernel@lists.infradead.org,
   linux-stm32@st-md-mailman.stormreply.com

   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.

> 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 <treding@nvidia.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>

> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> index 99e2e5a5cd60..78a492b91bc6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> @@ -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;
>  
> -- 
> 2.41.0
> 
>
patchwork-bot+netdevbpf@kernel.org July 29, 2023, 4:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 26 Jul 2023 18:32:00 +0200 you wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> 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 <treding@nvidia.com>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
index 99e2e5a5cd60..78a492b91bc6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
@@ -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;