summaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-10-01 22:18:19 +0800
committerMyungJoo Ham <myungjoo.ham@samsung.com>2015-10-02 11:05:58 +0900
commit6d3cbfa718eeedd70efb9eb04ce9b261b6fa5b7b (patch)
tree0bd2a0dc313bea46119fee336a2ea476e05b22ee /drivers/devfreq/devfreq.c
parent14a21e7ba8cf6eab968310c92ca19a00f13ce3d9 (diff)
downloadop-kernel-dev-6d3cbfa718eeedd70efb9eb04ce9b261b6fa5b7b.zip
op-kernel-dev-6d3cbfa718eeedd70efb9eb04ce9b261b6fa5b7b.tar.gz
PM / devfreq: fix double kfree
When device_register() fails, kfree(devfreq) is called already in devfreq_dev_release(), hence there is no need to call kfree(devfreq) in err_dev again. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 4f1b0ce..ca848cc 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -492,7 +492,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
if (err) {
put_device(&devfreq->dev);
mutex_unlock(&devfreq->lock);
- goto err_dev;
+ goto err_out;
}
mutex_unlock(&devfreq->lock);
@@ -518,7 +518,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
err_init:
list_del(&devfreq->node);
device_unregister(&devfreq->dev);
-err_dev:
kfree(devfreq);
err_out:
return ERR_PTR(err);
OpenPOWER on IntegriCloud