Skip to content
Commit 9612f8f5 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Lee Jones
Browse files

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: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 5b394b2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment