]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
PM / devfreq: fix double kfree
authorGeliang Tang <geliangtang@163.com>
Thu, 1 Oct 2015 14:18:19 +0000 (22:18 +0800)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 2 Oct 2015 02:05:58 +0000 (11:05 +0900)
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>
drivers/devfreq/devfreq.c

index 4f1b0cebe9a4c563a7d365c10a4d3787db93cb9f..ca848cc6a8fd1313bc56e5b93674b3d795814779 100644 (file)
@@ -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);