summaryrefslogtreecommitdiff
path: root/drivers/thermal/samsung
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2015-02-06 14:07:10 +0100
committerZhang Rui <rui.zhang@intel.com>2015-02-20 21:57:02 +0800
commit4531fa1684bb883ee01f1a182900b1e15d461b34 (patch)
tree835ca67f5df7664fd87b6b25ef9f1feb73d1a1e6 /drivers/thermal/samsung
parent3d883483dc0a7261d73d8b1857a7387a1dd99eee (diff)
thermal: exynos: fix: Check if data->tmu_read callback is present before read
The exynos_tmu_data() function should on entrance test not only for valid data pointer, but also for data->tmu_read one. It is important, since afterwards it is dereferenced to get temperature code. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/samsung')
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index fbeedc072cc2..933cd80a6bc5 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -716,7 +716,7 @@ static int exynos_get_temp(void *p, long *temp)
{
struct exynos_tmu_data *data = p;
- if (!data)
+ if (!data || !data->tmu_read)
return -EINVAL;
mutex_lock(&data->lock);