diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-03-11 23:39:51 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-03-16 11:55:55 +0100 |
commit | 9cf4789e6e4673d0b2c96fa6bb0c35e81b43111a (patch) | |
tree | 5e7b64c19aafc2d6167cfa82d4f7f8e8c191171d /drivers/rtc/rtc-imx-sc.c | |
parent | 7863bd076b990f57076f2123337b67b5d5ccd190 (diff) | |
download | linux-9cf4789e6e4673d0b2c96fa6bb0c35e81b43111a.tar.bz2 |
rtc: 88pm860x: fix possible race condition
The RTC IRQ is requested before the struct rtc_device is allocated,
this may lead to a NULL pointer dereference in the IRQ handler.
To fix this issue, allocating the rtc_device struct before requesting
the RTC IRQ using devm_rtc_allocate_device, and use rtc_register_device
to register the RTC device.
Also remove the unnecessary error message as the core already prints the
info.
Link: https://lore.kernel.org/r/20200311223956.51352-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-imx-sc.c')
0 files changed, 0 insertions, 0 deletions