]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:47:30 +0000 (06:47 -0700)
commitae087a4a56a64de9a07b042388cffc6be021c583
tree72f556e0656c0655211328909ade82703979d5a9
parent4775e99e29c881c25b1c5579045c5a643e4db850
rtc: xgene: fix possible race condition

[ Upstream commit a652e00ee1233e251a337c28e18a1da59224e5ce ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-xgene.c