lkml.org 
[lkml]   [2019]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V2] rtc: snvs: fix possible race condition
Date
Hi, Alexandre

> On 19/07/2019 11:01:02+0800, Anson.Huang@nxp.com wrote:
> > From: Anson Huang <Anson.Huang@nxp.com>
> >
> > The RTC IRQ is requested before the struct rtc_device is allocated,
> > this may lead to a NULL pointer dereference in IRQ handler.
> >
> > To fix this issue, allocating the rtc_device struct and register rtc
> > device before requesting the RTC IRQ.
> >
> > Using devm_rtc_allocate_device/rtc_register_device instead of
> > devm_rtc_device_register.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > Changes since V1:
> > - move devm_request_irq() to after rtc device register done, make
> sure everything
> > is ready before enabling IRQ.
>
> This opens another race condition, the first version of the patch was correct.

Hmm, OK, then we should go with V1.

Thanks,
Anson.
\
 
 \ /
  Last update: 2019-07-19 09:55    [W:1.198 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site