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>
This commit is contained in:
Lukasz Majewski 2015-02-06 14:07:10 +01:00 committed by Zhang Rui
parent 3d883483dc
commit 4531fa1684

View 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);