Alexandre Belloni 9a99247c9c rtc: vr41xx: fix possible race condition
The probe function is not allowed to fail after the RTC is registered
because the following may happen:

CPU0:                                CPU1:
sys_load_module()
 do_init_module()
  do_one_initcall()
   cmos_do_probe()
    rtc_device_register()
     __register_chrdev()
     cdev->owner = struct module*
                                     open("/dev/rtc0")
    rtc_device_unregister()
  module_put()
  free_module()
   module_free(mod->module_core)
   /* struct module *module is now
      freed */
                                      chrdev_open()
                                       spin_lock(cdev_lock)
                                       cdev_get()
                                        try_module_get()
                                         module_is_live()
                                         /* dereferences already
                                            freed struct module* */

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-05-17 22:54:19 +02:00
..
2018-04-10 10:22:27 -07:00
2018-04-10 10:22:27 -07:00
2018-03-27 10:45:05 +02:00
2018-05-17 22:23:14 +02:00
2018-03-17 14:20:56 +01:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2017-09-01 01:10:11 +02:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2017-09-01 01:10:11 +02:00
2016-05-20 12:33:51 +02:00
2018-03-17 14:20:50 +01:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:46:25 +02:00
2018-05-03 22:08:00 +02:00
2018-03-17 14:20:56 +01:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2017-08-22 12:05:21 +02:00
2016-05-20 12:33:51 +02:00
2017-09-05 09:55:02 +02:00
2018-05-17 22:43:22 +02:00
2018-03-17 14:20:57 +01:00
2017-08-24 11:03:35 +02:00
2018-05-03 22:11:50 +02:00
2018-05-03 22:08:00 +02:00
2018-05-03 22:08:00 +02:00
2018-03-17 14:20:54 +01:00
2018-05-03 22:08:00 +02:00
2018-05-17 22:37:11 +02:00
2016-05-20 12:33:51 +02:00
2018-05-03 22:08:00 +02:00