From: Sachin Kamat Date: Mon, 19 Aug 2013 06:28:42 +0000 (+0530) Subject: thermal: exynos: Fix potential NULL pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91ff81cf48f0c8f9cd608acbd83f0e98a228807b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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: Sachin Kamat Signed-off-by: Eduardo Valentin --- diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index 4d8e4445ea10..f10a6ad37c06 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -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; }