diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-02-13 01:47:49 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-03-01 12:49:30 +0300 |
commit | bcdd559268039d8340d38fa58668393596e29fdc (patch) | |
tree | de9e645878a31aafa2646c1692454155c53d2153 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 87c78d9512cb85c286de5a8941eaeda8ca6f7bac (diff) | |
download | linux-bcdd559268039d8340d38fa58668393596e29fdc.tar.xz |
rtc: rp5c01: fix possible race condition
The probe function is not allowed to fail after registering the RTC 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* */
Switch to devm_rtc_allocate_device/rtc_register_device to register the rtc
as late as possible.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions