[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250924145552.55058-1-sidharthseela@gmail.com>
Date: Wed, 24 Sep 2025 20:25:53 +0530
From: Sidharth Seela <sidharthseela@...il.com>
To: mturquette@...libre.com,
sboyd@...nel.org,
nicolas.ferre@...rochip.com,
alexandre.belloni@...tlin.com,
claudiu.beznea@...on.dev,
varshini.rajendran@...rochip.com
Cc: linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org,
david.hunter.linux@...il.com,
Sidharth Seela <sidharthseela@...il.com>
Subject: [PATCH RESEND] clk: at91: sam9x7: Use kmalloc_array() instead of kmalloc()
Replace kmalloc with kmalloc array in clk/at91/sam9x7.c. Refactor to new
API, for cases with dynamic size calculations inside kmalloc().
Resend is to correct previously sent patches mailing address.
Signed-off-by: Sidharth Seela <sidharthseela@...il.com>
---
diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index ffab32b047a0..0c0a746a183d 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -748,9 +748,9 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
if (!sam9x7_pmc)
return;
- clk_mux_buffer = kmalloc(sizeof(void *) *
- (ARRAY_SIZE(sam9x7_gck)),
- GFP_KERNEL);
+ clk_mux_buffer = kmalloc_array(ARRAY_SIZE(sam9x7_gck),
+ sizeof(void *),
+ GFP_KERNEL);
if (!clk_mux_buffer)
goto err_free;
--
2.39.5 (Apple Git-154)
Powered by blists - more mailing lists