On Sat, Jul 8, 2023 at 1:27 PM Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> wrote:
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@xxxxxxxxxxxxxx>
Daniel, this looks like a genuine fix to me, so I'm inclined to pick
it up directly.
Any objections?