]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: xgene: fix possible race condition
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 20 Mar 2019 12:32:27 +0000 (13:32 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 4 Apr 2019 08:07:08 +0000 (10:07 +0200)
commit95d659d068ae2297842fb91f1944154025fdce78
tree5d4a8cc07bf9a3e52519cca3d1d4fb23c2c4b708
parente2078c750e45515c483db14084cfb0e04ea1e980
rtc: xgene: 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.

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