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:
Yangtao Li 2019-01-19 11:04:54 -05:00 коммит произвёл MyungJoo Ham
Родитель 0d00a239f7
Коммит a9487917ba
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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);
}