mirror of https://gitee.com/openkylin/linux.git
PM / devfreq: fix mem leak in devfreq_add_device()
'devfreq' is malloced in devfreq_add_device() and should be freed in the error handling cases, otherwise it will cause memory leak. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
This commit is contained in:
parent
0d00a239f7
commit
a9487917ba
|
@ -651,7 +651,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||
mutex_unlock(&devfreq->lock);
|
||||
err = set_freq_table(devfreq);
|
||||
if (err < 0)
|
||||
goto err_out;
|
||||
goto err_dev;
|
||||
mutex_lock(&devfreq->lock);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue