diff options
Diffstat (limited to 'drivers/rtc/class.c')
| -rw-r--r-- | drivers/rtc/class.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index be5a6b73e601..e6539cbabb35 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/rtc.h> | 15 | #include <linux/rtc.h> |
| 16 | #include <linux/kdev_t.h> | 16 | #include <linux/kdev_t.h> |
| 17 | #include <linux/idr.h> | 17 | #include <linux/idr.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | 19 | ||
| 19 | #include "rtc-core.h" | 20 | #include "rtc-core.h" |
| 20 | 21 | ||
| @@ -157,8 +158,10 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, | |||
| 157 | rtc_dev_prepare(rtc); | 158 | rtc_dev_prepare(rtc); |
| 158 | 159 | ||
| 159 | err = device_register(&rtc->dev); | 160 | err = device_register(&rtc->dev); |
| 160 | if (err) | 161 | if (err) { |
| 162 | put_device(&rtc->dev); | ||
| 161 | goto exit_kfree; | 163 | goto exit_kfree; |
| 164 | } | ||
| 162 | 165 | ||
| 163 | rtc_dev_add_device(rtc); | 166 | rtc_dev_add_device(rtc); |
| 164 | rtc_sysfs_add_device(rtc); | 167 | rtc_sysfs_add_device(rtc); |
| @@ -226,6 +229,7 @@ static void __exit rtc_exit(void) | |||
| 226 | { | 229 | { |
| 227 | rtc_dev_exit(); | 230 | rtc_dev_exit(); |
| 228 | class_destroy(rtc_class); | 231 | class_destroy(rtc_class); |
| 232 | idr_destroy(&rtc_idr); | ||
| 229 | } | 233 | } |
| 230 | 234 | ||
| 231 | subsys_initcall(rtc_init); | 235 | subsys_initcall(rtc_init); |
