]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitcb20ddb6e6dd90663b929dc2ca6e141ffcbaba95
tree6ad3a9552223796c5efed06e7fb68c9ec5b8cd94
parent92af769ecedaad36076f07f33b6e0bef609778f7
rtc: xgene: fix possible race condition

BugLink: https://bugs.launchpad.net/bugs/1838700
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/rtc/rtc-xgene.c