diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-17 22:47:05 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-17 22:54:19 +0200 |
commit | 9a99247c9c1d1c95c6e8153d013979aac6111c6e (patch) | |
tree | 6b4b17e2938b65b13741360d4465b3db146e5b0d /drivers/rtc/rtc-rx8581.c | |
parent | 94389b28ba6c03eecf45105026c1f9978481a706 (diff) |
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>
Diffstat (limited to 'drivers/rtc/rtc-rx8581.c')
0 files changed, 0 insertions, 0 deletions