aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-11-22 19:43:18 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2024-11-22 19:43:18 -0800
commiteb78332b1067776ca4a474ccfd92460014e8d8e3 (patch)
treec9dc80d667c637e9f29a42ba7fb1f657fc655880 /tools
parentMerge tag 'pm-6.13-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm (diff)
parentMerge tag 'thermal-v6.13-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux (diff)
downloadwireguard-linux-eb78332b1067776ca4a474ccfd92460014e8d8e3.tar.xz
wireguard-linux-eb78332b1067776ca4a474ccfd92460014e8d8e3.zip
Merge tag 'thermal-6.13-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more thermal control updates from Rafael Wysocki: "These update a few thermal drivers used on ARM platforms and thermal tools: - Add SAR2130P compatible to DT bindings in the QCom Tsens driver (Dmitry Baryshkov) - Add static annotation to arrays describing platform sensors in the LVTS Mediatek driver (Colin Ian King) - Switch back to struct platform_driver::remove() from the previous callbacks prototype rework (Uwe Kleine-König) - Add MSM8937 compatible to DT bindings and its support in the QCom Tsens driver (Barnabás Czémán) - Remove a pointless sign test on an unsigned value in k3_bgp_read_temp() in the k3_j72xx_bandgap driver (Rex Nie) - Fix a pointer reference loss when realloc() fails in the thermal library (Zhang Jiao)" * tag 'thermal-6.13-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: tools/thermal: Fix common realloc mistake thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp() thermal/drivers/qcom/tsens-v1: Add support for MSM8937 tsens dt-bindings: thermal: tsens: Add MSM8937 thermal: Switch back to struct platform_driver::remove() thermal/drivers/mediatek/lvts_thermal: Make read-only arrays static const dt-bindings: thermal: qcom-tsens: Add SAR2130P compatible
Diffstat (limited to '')
-rw-r--r--tools/thermal/thermometer/thermometer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/thermal/thermometer/thermometer.c b/tools/thermal/thermometer/thermometer.c
index 1a87a0a77f9f..022865da8e3c 100644
--- a/tools/thermal/thermometer/thermometer.c
+++ b/tools/thermal/thermometer/thermometer.c
@@ -259,6 +259,7 @@ static int thermometer_add_tz(const char *path, const char *name, int polling,
{
int fd;
char tz_path[PATH_MAX];
+ struct tz *tz;
sprintf(tz_path, CLASS_THERMAL"/%s/temp", path);
@@ -268,13 +269,13 @@ static int thermometer_add_tz(const char *path, const char *name, int polling,
return -1;
}
- thermometer->tz = realloc(thermometer->tz,
- sizeof(*thermometer->tz) * (thermometer->nr_tz + 1));
- if (!thermometer->tz) {
+ tz = realloc(thermometer->tz, sizeof(*thermometer->tz) * (thermometer->nr_tz + 1));
+ if (!tz) {
ERROR("Failed to allocate thermometer->tz\n");
return -1;
}
+ thermometer->tz = tz;
thermometer->tz[thermometer->nr_tz].fd_temp = fd;
thermometer->tz[thermometer->nr_tz].name = strdup(name);
thermometer->tz[thermometer->nr_tz].polling = polling;