]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:47:48 +0000 (07:47 +0200)
commit4f4a958e27f302e3403a53e61efb4f0fb9067e93
treee093dc769a4b8364e23e44e22f8d331b47ff6416
parent954e00ba3e6fe6f38ac3d96d487ed883e75390e8
rtc: tps65910: fix possible race condition

[ 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>
drivers/rtc/rtc-tps65910.c