[PATCH 5.4] thermal: Fix NULL pointer dereferences in of_thermal_ functions