linux/tools/lib/thermal
Daniel Lezcano ad3dad3f15 thermal/lib: Fix memory leak on error in thermal_genl_auto()
[ Upstream commit 7569406e95 ]

The function thermal_genl_auto() does not free the allocated message
in the error path. Fix that by putting a out label and jump to it
which will free the message instead of directly returning an error.

Fixes: 47c4b0de08 ("tools/lib/thermal: Add a thermal library")
Reported-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20241024105938.1095358-1-daniel.lezcano@linaro.org
[ rjw: Fixed up the !msg error path, added Fixes tag ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-05 14:01:21 +01:00
..
include tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
.gitignore tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
Build tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
commands.c thermal/lib: Fix memory leak on error in thermal_genl_auto() 2024-12-05 14:01:21 +01:00
events.c tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
libthermal.map tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
libthermal.pc.template tools/lib/thermal: Fix include path for libnl3 in pkg-config file. 2023-02-15 17:29:40 +01:00
Makefile tools/lib/thermal: Remove the thermal.h soft link when doing make clean 2024-11-04 15:38:29 +01:00
sampling.c tools/lib/thermal: Fix sampling handler context ptr 2024-11-04 15:38:29 +01:00
thermal.c tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
thermal_nl.c tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00
thermal_nl.h tools/lib/thermal: Add a thermal library 2022-05-19 12:11:51 +02:00