提交 4531fa16 编写于 作者: L Lukasz Majewski 提交者: Zhang Rui

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: NLukasz Majewski <l.majewski@samsung.com>
Tested-by: NAbhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: NZhang Rui <rui.zhang@intel.com>
上级 3d883483
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册