mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 06:49:52 +00:00
thermal: k3_j72xx_bandgap: Use kcalloc() instead of kzalloc()
According to the latest recommendations, kcalloc() should be used instead of kzalloc() with multiplication (which might overflow). Switch to this new scheme and use more safe kcalloc(). No functional impact. Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Link: https://patch.msgid.link/20250224173432.1946070-3-lukasz.luba@arm.com [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
c65b5c5187
commit
83c34f5099
@ -460,13 +460,13 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
|
||||
goto err_alloc;
|
||||
}
|
||||
|
||||
ref_table = kzalloc(sizeof(*ref_table) * TABLE_SIZE, GFP_KERNEL);
|
||||
ref_table = kcalloc(TABLE_SIZE, sizeof(*ref_table), GFP_KERNEL);
|
||||
if (!ref_table) {
|
||||
ret = -ENOMEM;
|
||||
goto err_alloc;
|
||||
}
|
||||
|
||||
derived_table = devm_kzalloc(bgp->dev, sizeof(*derived_table) * TABLE_SIZE,
|
||||
derived_table = devm_kcalloc(bgp->dev, TABLE_SIZE, sizeof(*derived_table),
|
||||
GFP_KERNEL);
|
||||
if (!derived_table) {
|
||||
ret = -ENOMEM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user