mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] pinctrl: use kcalloc() instead of kzalloc()
@ 2025-08-19 14:39 Qianfeng Rong
  2025-08-19 14:39 ` [PATCH 1/4] pinctrl: microchip-sgpio: " Qianfeng Rong
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Qianfeng Rong @ 2025-08-19 14:39 UTC (permalink / raw)
  To: Steen Hegelund, Daniel Machon,
	maintainer:ARM/Microchip Sparx5 SoC support, Linus Walleij,
	Michal Simek, Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, moderated list:ARM/Microchip Sparx5 SoC support,
	open list:PIN CONTROL SUBSYSTEM, open list,
	open list:ARM/QUALCOMM MAILING LIST,
	open list:ARM/Allwinner sunXi SoC support
  Cc: Qianfeng Rong

Replace devm_kzalloc() with devm_kcalloc() in drivers/pinctrl.  As noted
in the kernel documentation [1], open-coded multiplication in allocator
arguments is discouraged because it can lead to integer overflow.

Use devm_kcalloc() to gain built-in overflow protection, making memory
allocation safer when calculating allocation size compared to explicit
multiplication.

[1]: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Qianfeng Rong (4):
  pinctrl: microchip-sgpio: use kcalloc() instead of kzalloc()
  pinctrl: pinctrl-zynqmp: use kcalloc() instead of kzalloc()
  pinctrl: qcom: sc8180x: use kcalloc() instead of kzalloc()
  pinctrl: sunxi: use kcalloc() instead of kzalloc()

 drivers/pinctrl/pinctrl-microchip-sgpio.c | 2 +-
 drivers/pinctrl/pinctrl-zynqmp.c          | 2 +-
 drivers/pinctrl/qcom/pinctrl-sc8180x.c    | 2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c  | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-21 11:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-19 14:39 [PATCH 0/4] pinctrl: use kcalloc() instead of kzalloc() Qianfeng Rong
2025-08-19 14:39 ` [PATCH 1/4] pinctrl: microchip-sgpio: " Qianfeng Rong
2025-08-19 14:39 ` [PATCH 2/4] pinctrl: pinctrl-zynqmp: " Qianfeng Rong
2025-08-20  8:02   ` Michal Simek
2025-08-19 14:39 ` [PATCH 3/4] pinctrl: qcom: sc8180x: " Qianfeng Rong
2025-08-19 18:37   ` Dmitry Baryshkov
2025-08-19 14:39 ` [PATCH 4/4] pinctrl: sunxi: " Qianfeng Rong
2025-08-20 13:17   ` Chen-Yu Tsai
2025-08-21 11:29 ` [PATCH 0/4] pinctrl: " Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®