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 коммит произвёл Zhang Rui
Родитель 3d883483dc
Коммит 4531fa1684
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

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