Skip to content
Commit 87260d3f authored by Dirk Behme's avatar Dirk Behme Committed by Zhang Rui
Browse files

thermal: rcar_thermal: Fix priv->zone error handling



In case thermal_zone_xxx_register() returns an error, priv->zone
isn't NULL any more, but contains the error code.

This is passed to thermal_zone_device_unregister(), then. This checks
for priv->zone being NULL, but the error code is != NULL. So it works
with the error code as a pointer. Crashing immediately.

To fix this, reset priv->zone to NULL before entering
rcar_gen3_thermal_remove().

Signed-off-by: default avatarDirk Behme <dirk.behme@de.bosch.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent c6935931
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