commit | 1097998d27da39578542e79ff865b4d74e755cd0 | [log] [tgz] |
---|---|---|
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | Wed Mar 20 12:30:09 2019 +0100 |
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | Thu Apr 04 10:07:09 2019 +0200 |
tree | dbaf06cbb95fd81e353363c4a45c3bd8bb50f9c5 | |
parent | 9852023d204b97324e7fa84f50f28a9d602b79fb [diff] |
rtc: sh: fix possible race condition The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc struct before requesting the IRQ. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>