Re: [PATCH] thermal: exynos: fix: Check if data->tmu_read callback is present before read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eduardo,

> 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@xxxxxxxxxxx>
> ---
>  drivers/thermal/samsung/exynos_tmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c
> b/drivers/thermal/samsung/exynos_tmu.c index 3a19353..a86e0495e 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -717,7 +717,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);

This fix shall be added to v3.20.

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux