Searched hist:"9612 f8f503804d2fd2f63aa6ba1e58bba4612d96" (Results 1 – 1 of 1) sorted by relevance
/linux/drivers/mfd/ |
H A D | menelaus.c | diff 9612f8f503804d2fd2f63aa6ba1e58bba4612d96 Sun Sep 09 22:48:58 CEST 2018 Alexandre Belloni <alexandre.belloni@bootlin.com> mfd: menelaus: Fix possible race condition and leak
The IRQ work is added 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 calling menelaus_add_irq_work.
Also, this solves a possible leak as the RTC is never released.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
|