[openEuler-5.10 20/21] thermal: Fix NULL pointer dereferences in of_thermal_ functions