When device_register() returns with error, it has already done put_device() on the input device pointer. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
@@ -564,7 +564,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
dev_set_name(&devfreq->dev, "%s", dev_name(dev));
err = device_register(&devfreq->dev);
if (err) {
- put_device(&devfreq->dev);
mutex_unlock(&devfreq->lock);
goto err_out;
}