aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/exynos_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/exynos_thermal.c')
-rw-r--r--drivers/thermal/exynos_thermal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index e84acde9e0bf..fd03e8581afc 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -475,11 +475,14 @@ static void exynos_unregister_thermal(void)
475{ 475{
476 int i; 476 int i;
477 477
478 if (th_zone && th_zone->therm_dev) 478 if (!th_zone)
479 return;
480
481 if (th_zone->therm_dev)
479 thermal_zone_device_unregister(th_zone->therm_dev); 482 thermal_zone_device_unregister(th_zone->therm_dev);
480 483
481 for (i = 0; i < th_zone->cool_dev_size; i++) { 484 for (i = 0; i < th_zone->cool_dev_size; i++) {
482 if (th_zone && th_zone->cool_dev[i]) 485 if (th_zone->cool_dev[i])
483 cpufreq_cooling_unregister(th_zone->cool_dev[i]); 486 cpufreq_cooling_unregister(th_zone->cool_dev[i]);
484 } 487 }
485 488