aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2019-01-19 11:04:54 -0500
committerMyungJoo Ham <myungjoo.ham@samsung.com>2019-04-16 09:29:18 +0900
commita9487917ba6728dd618ae6d418a7f2197f1b4592 (patch)
tree8d2ba76caaeedfed1f4c9ebe6c320c706bd55a83 /drivers/devfreq
parentPM / devfreq: Use of_node_name_eq for node name comparisons (diff)
downloadlinux-dev-a9487917ba6728dd618ae6d418a7f2197f1b4592.tar.xz
linux-dev-a9487917ba6728dd618ae6d418a7f2197f1b4592.zip
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>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/devfreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 0ae3de76833b..fa1bdde89ffc 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -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);
}