Skip to content
Snippets Groups Projects
Commit 4531fa16 authored by Lukasz Majewski's avatar Lukasz Majewski Committed by Zhang Rui
Browse files

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: default avatarLukasz Majewski <l.majewski@samsung.com>
Tested-by: default avatarAbhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 3d883483
No related branches found
No related tags found
No related merge requests found
...@@ -716,7 +716,7 @@ static int exynos_get_temp(void *p, long *temp) ...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment