mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
regulator: bd718x7: Use kcalloc() instead of kzalloc()
Replace calls of 'devm_kzalloc(dev, count * sizeof([type]), flags)' with 'devm_kcalloc(dev, count, sizeof([type]), flags)' in setup_feedback_loop() for safer memory allocation with built-in overflow protection. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://patch.msgid.link/20250817142327.174531-1-rongqianfeng@vivo.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6d068f1ae2
commit
550bc517e5
|
|
@ -1598,7 +1598,7 @@ static int setup_feedback_loop(struct device *dev, struct device_node *np,
|
|||
if (desc->n_linear_ranges && desc->linear_ranges) {
|
||||
struct linear_range *new;
|
||||
|
||||
new = devm_kzalloc(dev, desc->n_linear_ranges *
|
||||
new = devm_kcalloc(dev, desc->n_linear_ranges,
|
||||
sizeof(struct linear_range),
|
||||
GFP_KERNEL);
|
||||
if (!new)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user