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:
Qianfeng Rong
2025-08-19 11:59:34 +08:00
committed by Bjorn Andersson
parent cf13bed78c
commit 4ea9e8e506

View File

@@ -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;