Re: [PATCH] rtc: snvs: fix possible race condition

2019-08-29 Thread Alexandre Belloni
On 16/07/2019 15:18:58+0800, anson.hu...@nxp.com wrote: > From: Anson Huang > > 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 before requesting > the RTC

RE: [PATCH] rtc: snvs: fix possible race condition

2019-08-13 Thread Anson Huang
Hi, Alexandre > On 19/07/2019 19:04:21+, Trent Piepho wrote: > > On Fri, 2019-07-19 at 02:57 +, Anson Huang wrote: > > > > > > > I do worry that handling the irq before the rtc device is > > > > registered could still result in a crash. From what I saw, the > > > > irq path in snvs only

Re: [PATCH] rtc: snvs: fix possible race condition

2019-07-20 Thread Alexandre Belloni
On 19/07/2019 19:04:21+, Trent Piepho wrote: > On Fri, 2019-07-19 at 02:57 +, Anson Huang wrote: > > > > > I do worry that handling the irq before the rtc device is registered > > > could still > > > result in a crash. From what I saw, the irq path in snvs only uses > > > driver state

Re: [PATCH] rtc: snvs: fix possible race condition

2019-07-19 Thread Trent Piepho
On Fri, 2019-07-19 at 02:57 +, Anson Huang wrote: > > > I do worry that handling the irq before the rtc device is registered could > > still > > result in a crash. From what I saw, the irq path in snvs only uses driver > > state > > members that are fully initialized for the most part, and

RE: [PATCH] rtc: snvs: fix possible race condition

2019-07-18 Thread Anson Huang
Hi, Trent > On Thu, 2019-07-18 at 03:08 +, Aisheng Dong wrote: > > > From: Anson Huang > > > Sent: Wednesday, July 17, 2019 9:58 PM> Hi, Aisheng > > > > > > > > From: anson.hu...@nxp.com > > > > > Sent: Tuesday, July 16, 2019 3:19 PM > > > > > > > > > > The RTC IRQ is requested before the

Re: [PATCH] rtc: snvs: fix possible race condition

2019-07-18 Thread Trent Piepho
On Thu, 2019-07-18 at 03:08 +, Aisheng Dong wrote: > > From: Anson Huang > > Sent: Wednesday, July 17, 2019 9:58 PM> > > Hi, Aisheng > > > > > > From: anson.hu...@nxp.com > > > > Sent: Tuesday, July 16, 2019 3:19 PM > > > > > > > > The RTC IRQ is requested before the struct rtc_device is >

RE: [PATCH] rtc: snvs: fix possible race condition

2019-07-17 Thread Aisheng Dong
> From: Anson Huang > Sent: Wednesday, July 17, 2019 9:58 PM> > Hi, Aisheng > > > > From: anson.hu...@nxp.com > > > Sent: Tuesday, July 16, 2019 3:19 PM > > > > > > The RTC IRQ is requested before the struct rtc_device is allocated, > > > this may lead to a NULL pointer dereference in IRQ

RE: [PATCH] rtc: snvs: fix possible race condition

2019-07-17 Thread Anson Huang
Hi, Aisheng > > From: anson.hu...@nxp.com > > Sent: Tuesday, July 16, 2019 3:19 PM > > > > 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 before

RE: [PATCH] rtc: snvs: fix possible race condition

2019-07-17 Thread Aisheng Dong
> From: anson.hu...@nxp.com > Sent: Tuesday, July 16, 2019 3:19 PM > > 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 before requesting the RTC > IRQ >

[PATCH] rtc: snvs: fix possible race condition

2019-07-16 Thread Anson . Huang
From: Anson Huang 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 before requesting the RTC IRQ using devm_rtc_allocate_device, and use rtc_register_device to