]> Git Repo - linux.git/commitdiff
thermal: exynos: fix: Check if data->tmu_read callback is present before read
authorLukasz Majewski <[email protected]>
Fri, 6 Feb 2015 13:07:10 +0000 (14:07 +0100)
committerZhang Rui <[email protected]>
Fri, 20 Feb 2015 13:57:02 +0000 (21:57 +0800)
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 <[email protected]>
Tested-by: Abhilash Kesavan <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
drivers/thermal/samsung/exynos_tmu.c

index fbeedc072cc2eb1ec8c84003d90997fdceabe989..933cd80a6bc5693e23da36048461bfd6250ba40b 100644 (file)
@@ -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);
This page took 0.054087 seconds and 4 git commands to generate.