Skip to content
Commit a5f785ce authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Daniel Lezcano
Browse files

thermal: core: Fix use-after-free in thermal_zone_device_unregister()



The user-after-free bug in thermal_zone_device_unregister() is reported by
KASAN. It happens because struct thermal_zone_device is released during of
device_unregister() invocation, and hence the "tz" variable shouldn't be
touched by thermal_notify_tz_delete(tz->id).

Fixes: 55cdf0a2 ("thermal: core: Add notifications call in the framework")
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200817235854.26816-1-digetx@gmail.com
parent 0ffdab6f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment