* [PATCH] spi: SPISG: Use devm_kcalloc() in aml_spisg_clk_init()
@ 2025-08-19 4:02 Qianfeng Rong
2025-08-19 15:38 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Qianfeng Rong @ 2025-08-19 4:02 UTC (permalink / raw)
To: Sunny Luo, Xianwei Zhao, Mark Brown, linux-amlogic, linux-spi,
linux-kernel
Cc: Qianfeng Rong
Replace calls of devm_kzalloc() with devm_kcalloc() in aml_spisg_clk_init()
for safer memory allocation with built-in overflow protection, and replace
sizeof(struct clk_div_table) with sizeof(*tbl) to shorten the line.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/spi/spi-amlogic-spisg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
index 2ab8bdf2a676..64244a0bd408 100644
--- a/drivers/spi/spi-amlogic-spisg.c
+++ b/drivers/spi/spi-amlogic-spisg.c
@@ -662,7 +662,7 @@ static int aml_spisg_clk_init(struct spisg_device *spisg, void __iomem *base)
clk_disable_unprepare(spisg->pclk);
- tbl = devm_kzalloc(dev, sizeof(struct clk_div_table) * (DIV_NUM + 1), GFP_KERNEL);
+ tbl = devm_kcalloc(dev, (DIV_NUM + 1), sizeof(*tbl), GFP_KERNEL);
if (!tbl)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: SPISG: Use devm_kcalloc() in aml_spisg_clk_init()
2025-08-19 4:02 [PATCH] spi: SPISG: Use devm_kcalloc() in aml_spisg_clk_init() Qianfeng Rong
@ 2025-08-19 15:38 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-08-19 15:38 UTC (permalink / raw)
To: Sunny Luo, Xianwei Zhao, linux-amlogic, linux-spi, linux-kernel,
Qianfeng Rong
On Tue, 19 Aug 2025 12:02:38 +0800, Qianfeng Rong wrote:
> Replace calls of devm_kzalloc() with devm_kcalloc() in aml_spisg_clk_init()
> for safer memory allocation with built-in overflow protection, and replace
> sizeof(struct clk_div_table) with sizeof(*tbl) to shorten the line.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: SPISG: Use devm_kcalloc() in aml_spisg_clk_init()
commit: c1dd310f1d76b4b13f1854618087af2513140897
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-19 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 4:02 [PATCH] spi: SPISG: Use devm_kcalloc() in aml_spisg_clk_init() Qianfeng Rong
2025-08-19 15:38 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).