}
tzp = pos->tzp;
- if (!tzp->tbp)
- return;
+ if (!tzp || !tzp->tbp)
+ continue;
for (i = 0; i < tzp->num_tbps; i++) {
if (tzp->tbp[i].cdev || !tzp->tbp[i].match)
goto exit;
}
- if (!tzp->tbp)
+ if (!tzp || !tzp->tbp)
goto exit;
list_for_each_entry(pos, &thermal_cdev_list, node) {
ret = tz->ops->get_temp(tz, &temp);
if (ret) {
pr_warn("failed to read out thermal zone %d\n", tz->id);
- return;
+ goto exit;
}
tz->last_temperature = tz->temperature;
tz->temperature = temp;
+exit:
mutex_unlock(&tz->lock);
}