linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anson Huang <anson.huang@nxp.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: "a.zummo@towertech.it" <a.zummo@towertech.it>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH V2] rtc: snvs: fix possible race condition
Date: Fri, 19 Jul 2019 07:54:40 +0000	[thread overview]
Message-ID: <DB3PR0402MB3916A9FED386A432551132B0F5CB0@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20190719073316.GA4012@piout.net>

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.

      reply	other threads:[~2019-07-19  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19  3:01 [PATCH V2] rtc: snvs: fix possible race condition Anson.Huang
2019-07-19  7:33 ` Alexandre Belloni
2019-07-19  7:54   ` Anson Huang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB3PR0402MB3916A9FED386A432551132B0F5CB0@DB3PR0402MB3916.eurprd04.prod.outlook.com \
    --to=anson.huang@nxp.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).