Commit 91ff81cf authored by Sachin Kamat's avatar Sachin Kamat Committed by Eduardo Valentin

thermal: exynos: Fix potential NULL pointer dereference

NULL pointer was being dereferenced in its own error message.
Changed it to the correct device pointer.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarEduardo Valentin <eduardo.valentin@ti.com>
parent 02ae59dc
...@@ -53,7 +53,7 @@ static int exynos_set_mode(struct thermal_zone_device *thermal, ...@@ -53,7 +53,7 @@ static int exynos_set_mode(struct thermal_zone_device *thermal,
{ {
struct exynos_thermal_zone *th_zone = thermal->devdata; struct exynos_thermal_zone *th_zone = thermal->devdata;
if (!th_zone) { if (!th_zone) {
dev_err(th_zone->sensor_conf->dev, dev_err(&thermal->device,
"thermal zone not registered\n"); "thermal zone not registered\n");
return 0; return 0;
} }
...@@ -231,7 +231,7 @@ static int exynos_get_temp(struct thermal_zone_device *thermal, ...@@ -231,7 +231,7 @@ static int exynos_get_temp(struct thermal_zone_device *thermal,
void *data; void *data;
if (!th_zone->sensor_conf) { if (!th_zone->sensor_conf) {
dev_err(th_zone->sensor_conf->dev, dev_err(&thermal->device,
"Temperature sensor not initialised\n"); "Temperature sensor not initialised\n");
return -EINVAL; return -EINVAL;
} }
...@@ -251,7 +251,7 @@ static int exynos_set_emul_temp(struct thermal_zone_device *thermal, ...@@ -251,7 +251,7 @@ static int exynos_set_emul_temp(struct thermal_zone_device *thermal,
struct exynos_thermal_zone *th_zone = thermal->devdata; struct exynos_thermal_zone *th_zone = thermal->devdata;
if (!th_zone->sensor_conf) { if (!th_zone->sensor_conf) {
dev_err(th_zone->sensor_conf->dev, dev_err(&thermal->device,
"Temperature sensor not initialised\n"); "Temperature sensor not initialised\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
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