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 committed by MyungJoo Ham
parent 0d00a239f7
commit a9487917ba
1 changed files with 1 additions and 1 deletions

View File

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