diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-07-08 14:27:20 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-07-24 10:51:31 +0300 |
commit | ac4436a5b20e0ef1f608a9ef46c08d5d142f8da6 (patch) | |
tree | 6edd068712e4033e455061612bd9ab648f7d1827 /drivers/thermal/imx_sc_thermal.c | |
parent | 80ddce5f2dbd0e83eadc9f9d373439180d599fe5 (diff) | |
download | linux-ac4436a5b20e0ef1f608a9ef46c08d5d142f8da6.tar.xz |
thermal: of: fix double-free on unregistration
Since commit 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal
zone parameters structure"), thermal_zone_device_register() allocates
a copy of the tzp argument and frees it when unregistering, so
thermal_of_zone_register() now ends up leaking its original tzp and
double-freeing the tzp copy. Fix this by locating tzp on stack instead.
Fixes: 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: 6.4+ <stable@vger.kernel.org> # 6.4+: 8bcbb18c61d6: thermal: core: constify params in thermal_zone_device_register
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/imx_sc_thermal.c')
0 files changed, 0 insertions, 0 deletions