thermal: exynos: Fix potential NULL pointer dereference
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 19 Aug 2013 06:28:42 +0000 (11:58 +0530)
committerEduardo Valentin <eduardo.valentin@ti.com>
Thu, 29 Aug 2013 13:37:28 +0000 (09:37 -0400)
NULL pointer was being dereferenced in its own error message.
Changed it to the correct device pointer.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
drivers/thermal/samsung/exynos_thermal_common.c

index 4d8e4445ea102560e9f7d711560b42a82b95dcf5..f10a6ad37c0609fd2383061d1c4f651bb9cde36b 100644 (file)
@@ -53,7 +53,7 @@ static int exynos_set_mode(struct thermal_zone_device *thermal,
 {
        struct exynos_thermal_zone *th_zone = thermal->devdata;
        if (!th_zone) {
-               dev_err(th_zone->sensor_conf->dev,
+               dev_err(&thermal->device,
                        "thermal zone not registered\n");
                return 0;
        }
@@ -231,7 +231,7 @@ static int exynos_get_temp(struct thermal_zone_device *thermal,
        void *data;
 
        if (!th_zone->sensor_conf) {
-               dev_err(th_zone->sensor_conf->dev,
+               dev_err(&thermal->device,
                        "Temperature sensor not initialised\n");
                return -EINVAL;
        }
@@ -251,7 +251,7 @@ static int exynos_set_emul_temp(struct thermal_zone_device *thermal,
        struct exynos_thermal_zone *th_zone = thermal->devdata;
 
        if (!th_zone->sensor_conf) {
-               dev_err(th_zone->sensor_conf->dev,
+               dev_err(&thermal->device,
                        "Temperature sensor not initialised\n");
                return -EINVAL;
        }