]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
rtc: tps65910: fix possible race condition
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 17 May 2018 20:26:21 +0000 (22:26 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:42 +0000 (14:20 +0100)
commit3037aa1ba984f296bbcdb7cc955c659b86743ec6
treec9afecd2de3f5aebf5b8483012c54c39243c93b0
parentd0ff13fbbfc6477b175999f04ced3089d5086cbe
rtc: tps65910: fix possible race condition

BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit e6000a438e534ee0afd9e83b67f4e23a26dd1067 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/rtc/rtc-tps65910.c