Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);