提交 a9487917 编写于 作者: Y Yangtao Li 提交者: MyungJoo Ham

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: NYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
上级 0d00a239
...@@ -651,7 +651,7 @@ struct devfreq *devfreq_add_device(struct device *dev, ...@@ -651,7 +651,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
mutex_unlock(&devfreq->lock); mutex_unlock(&devfreq->lock);
err = set_freq_table(devfreq); err = set_freq_table(devfreq);
if (err < 0) if (err < 0)
goto err_out; goto err_dev;
mutex_lock(&devfreq->lock); mutex_lock(&devfreq->lock);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册