]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
rtc: 88pm80x: fix possible race condition
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 17 May 2018 20:18:58 +0000 (22:18 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 17 May 2018 20:23:18 +0000 (22:23 +0200)
commit661eb89a11c5f39249d8d0d50b4e538ef7bdd9d6
tree9c759dbfa77c1ddfdd7952cd1722ee7c62813a40
parentba78d51bdf97e67d6ae37075fa34c75068c2938e
rtc: 88pm80x: fix possible race condition

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>
drivers/rtc/rtc-88pm80x.c