Re: [PATCH 1/3] rtc: mt6397: fix possible race condition

2018-09-11 Thread Eddie Huang
On Sun, 2018-09-09 at 22:38 +0200, Alexandre Belloni wrote: > 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

[PATCH 1/3] rtc: mt6397: fix possible race condition

2018-09-09 Thread Alexandre Belloni
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. Cc: Eddie Huang Cc: Sean Wang Si