lkml.org 
[lkml]   [2019]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rtc: snvs: fix possible race condition
On 16/07/2019 15:18:58+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 before requesting
> the RTC IRQ using devm_rtc_allocate_device, and use rtc_register_device
> to register the RTC device.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> drivers/rtc/rtc-snvs.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
Applied, thanks.

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2019-08-29 17:40    [W:0.154 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site