> 'devfreq' is malloced in devfreq_add_device() and should be freed in
> the error handling cases, otherwise it will cause memory leak.
>
> devm_kzalloc() could fail, so insert a check of its return value. And
> if it fails, returns -ENOMEM.
>
> Signed-off-by: Yangtao Li
Dear Yangtao,
Could
> Also, you better to add following codes to free the memory of
> 'devfreq->trans_table' and 'devfreq->time_in_state' because this patch
> handles the memory leak of 'trans_table' and 'time_in_state'
> variables.
Hi Chanwoo:
Isn't that the mem requested by the devm_ API automatically freed when
Hi Yangtao,
2019년 1월 19일 (토) 오후 2:03, Yangtao Li 님이 작성:
>
> 'devfreq' is malloced in devfreq_add_device() and should be freed in
> the error handling cases, otherwise it will cause memory leak.
>
> devm_kzalloc() could fail, so insert a check of its return value. And
> if it fails, returns
'devfreq' is malloced in devfreq_add_device() and should be freed in
the error handling cases, otherwise it will cause memory leak.
devm_kzalloc() could fail, so insert a check of its return value. And
if it fails, returns -ENOMEM.
Signed-off-by: Yangtao Li
---
drivers/devfreq/devfreq.c | 33
4 matches
Mail list logo