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:
Родитель
3d883483dc
Коммит
4531fa1684
|
@ -716,7 +716,7 @@ static int exynos_get_temp(void *p, long *temp)
|
||||||
{
|
{
|
||||||
struct exynos_tmu_data *data = p;
|
struct exynos_tmu_data *data = p;
|
||||||
|
|
||||||
if (!data)
|
if (!data || !data->tmu_read)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
mutex_lock(&data->lock);
|
mutex_lock(&data->lock);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче