rtc: tps65910: fix possible race condition
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 17 May 2018 20:26:21 +0000 (22:26 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 17 May 2018 20:37:07 +0000 (22:37 +0200)
commite6000a438e534ee0afd9e83b67f4e23a26dd1067
tree37c62ebda4ce3520c217f250a17e13b1ba28ac50
parentc402f8ead68ccd05d63f79ab729184498c3467b3
rtc: tps65910: 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-tps65910.c