]> git.ipfire.org Git - thirdparty/kernel/stable.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:45:11 +0000 (06:45 -0700)
commitafbc04c3e1daa14ab1beb9e896cd77e7f5693c63
treec0b938311d8eec29e2b8a592b01c20a9ddb098d6
parent306e799b6d9e8f286e9e19f83f68c3144f5e2fde
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