Merge tag 'overflow-v4.18-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / thermal / of-thermal.c
index eea2fce..977a830 100644 (file)
@@ -853,7 +853,7 @@ __init *thermal_of_build_thermal_zone(struct device_node *np)
        if (tz->ntrips == 0) /* must have at least one child */
                goto finish;
 
-       tz->trips = kzalloc(tz->ntrips * sizeof(*tz->trips), GFP_KERNEL);
+       tz->trips = kcalloc(tz->ntrips, sizeof(*tz->trips), GFP_KERNEL);
        if (!tz->trips) {
                ret = -ENOMEM;
                goto free_tz;
@@ -879,7 +879,7 @@ __init *thermal_of_build_thermal_zone(struct device_node *np)
        if (tz->num_tbps == 0)
                goto finish;
 
-       tz->tbps = kzalloc(tz->num_tbps * sizeof(*tz->tbps), GFP_KERNEL);
+       tz->tbps = kcalloc(tz->num_tbps, sizeof(*tz->tbps), GFP_KERNEL);
        if (!tz->tbps) {
                ret = -ENOMEM;
                goto free_trips;