diff options
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r-- | drivers/rtc/class.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 3243832a17cd..9583cbcc6b79 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -171,8 +171,10 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, | |||
171 | rtc_dev_prepare(rtc); | 171 | rtc_dev_prepare(rtc); |
172 | 172 | ||
173 | err = device_register(&rtc->dev); | 173 | err = device_register(&rtc->dev); |
174 | if (err) | 174 | if (err) { |
175 | put_device(&rtc->dev); | ||
175 | goto exit_kfree; | 176 | goto exit_kfree; |
177 | } | ||
176 | 178 | ||
177 | rtc_dev_add_device(rtc); | 179 | rtc_dev_add_device(rtc); |
178 | rtc_sysfs_add_device(rtc); | 180 | rtc_sysfs_add_device(rtc); |