mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08:00
soc: qcom: use devm_kcalloc() for array space allocation
Replace calls of devm_kzalloc() with devm_kcalloc() in master_stats_probe() for safer memory allocation with built-in overflow protection. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Link: https://lore.kernel.org/r/20250819035935.434121-1-rongqianfeng@vivo.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
cf13bed78c
commit
4ea9e8e506
@@ -78,7 +78,7 @@ static int master_stats_probe(struct platform_device *pdev)
|
||||
if (count < 0)
|
||||
return count;
|
||||
|
||||
data = devm_kzalloc(dev, count * sizeof(*data), GFP_KERNEL);
|
||||
data = devm_kcalloc(dev, count, sizeof(*data), GFP_KERNEL);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user