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>
This commit is contained in:
parent
14a21e7ba8
commit
6d3cbfa718
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue