aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLukasz Luba <lukasz.luba@arm.com>2025-02-24 17:33:05 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-02-26 20:55:42 +0100
commite6c0525fc6afb2e88c02b13a58a036d95492e6f6 (patch)
tree90c4cf9057bff24352785f7852b0c590b8b059ad
parentthermal: k3_j72xx_bandgap: Use kcalloc() instead of kzalloc() (diff)
downloadwireguard-linux-e6c0525fc6afb2e88c02b13a58a036d95492e6f6.tar.xz
wireguard-linux-e6c0525fc6afb2e88c02b13a58a036d95492e6f6.zip
thermal: int340x: Use kcalloc() instead of kzalloc() with multiplication
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-4-lukasz.luba@arm.com [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
index 8dca6a6aceca..2d672c4be3ce 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -133,8 +133,8 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
if (ACPI_SUCCESS(status))
int34x_zone->aux_trip_nr = trip_cnt;
- zone_trips = kzalloc(sizeof(*zone_trips) * (trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT),
- GFP_KERNEL);
+ zone_trips = kcalloc(trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT,
+ sizeof(*zone_trips), GFP_KERNEL);
if (!zone_trips) {
ret = -ENOMEM;
goto err_trips_alloc;