RE: [PATCH] PM / devfreq: fix mem leak and missing check of return value in devfreq_add_device()

From: MyungJoo Ham
Date: Mon Jan 21 2019 - 02:18:53 EST


> '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 <tiny.windzz@xxxxxxxxx>

Dear Yangtao,

Could you please make your patch without indentation style changes?


The label, "err_devfreq", would fit more if it's renamed "err_kzalloc".


Cheers,
MyungJoo.