mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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:
parent
3d883483dc
commit
4531fa1684
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user