rtc: armada38x: fix possible race condition
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 24 Sep 2018 14:25:34 +0000 (16:25 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 28 Sep 2018 12:21:02 +0000 (14:21 +0200)
commit7d61cbb945a753af08e247b5f10bdd5dbb8d6c80
tree25903fd8ee17b5ae10cdd068cdd8d2bce9b166ff
parent0ae3f24ded773edcc5e40ed94c84fbfabd516e14
rtc: armada38x: 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
before requesting the IRQ.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-armada38x.c