Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2477873ybl; Thu, 29 Aug 2019 08:42:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxBCz754zHakbL6YdT089QJ2ynkk+mIi3YOUehDZQQMWRChN4L1oQ2i/Nci+H2JgusfQIb X-Received: by 2002:a63:f857:: with SMTP id v23mr8889898pgj.228.1567093351381; Thu, 29 Aug 2019 08:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567093351; cv=none; d=google.com; s=arc-20160816; b=ACab57TrbSD5G1pVljzqlG55B0l8em2YF0+/wkJm88NDMKhKPDGdsXWs2Rc0yNF2VA lJ9Q08xIFYOilsoj2rBDWgB8kpMJAv9hj4b7E36RnbQ+WGq5f+uZbrCK8b6bwsK3KP58 ynwXKBOo/9lrKWlJxxgiK5FBxnBQWvZD/PQ1/Gqvh8x3e18+dUscs99lfFmq2VX+OxVE K7F0N52dgh10iZxenY2o+i56H/Y0dYudFkkCnIzsUct4jrf8ZM36pB52BAKd9GD7jYj7 JefH4GOmC4ESwoIHDzQT2dBQ7ceshEkvziDZYjM8m6iErcqpIYIQpUYWloRpbXx0HUSH Nn3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DSZjkTfF4ObiCkCjMj44YZPv84ZcDymlQqaeO/Lp/II=; b=nSp05BOH4fPVsl0A9Wik8JtZ03Kw3FovHhGHZRu76TLl79N7SB9T8t5bBjn0P2KbuW IBUw4Pr2oMBlQD+QGDyCOL3Wzf6atYIGH3j5rTrptVO1g6wAHtgTSbYdbRw+q2uVp8Y6 KqDBalMhwhNVhUk/P9WrKcWRWW1mFYYZL8xU6UBgkJIaqzamc9yEDiwqp7bwRVUWhaUU MYB6WpWgYc/Pbpyr5nvrIWnbS6zxohTfNrJaTbQchXIZrVaKEMuMRe1dTbQoxerfCV1N kIPJ5zEj1M/qIQFiGbVsRY0w15cgrjsWSOqPDTUIAXCxywSd+412he96gdXfWnddLPDq 6gFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t184si2300890pgd.211.2019.08.29.08.42.15; Thu, 29 Aug 2019 08:42:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727984AbfH2Pju (ORCPT + 99 others); Thu, 29 Aug 2019 11:39:50 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:50469 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727947AbfH2Pjt (ORCPT ); Thu, 29 Aug 2019 11:39:49 -0400 X-Originating-IP: 86.207.98.53 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E8D0E240007; Thu, 29 Aug 2019 15:39:47 +0000 (UTC) Date: Thu, 29 Aug 2019 17:39:42 +0200 From: Alexandre Belloni To: Anson.Huang@nxp.com Cc: a.zummo@towertech.it, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-imx@nxp.com Subject: Re: [PATCH] rtc: snvs: fix possible race condition Message-ID: <20190829153942.GK21922@piout.net> References: <20190716071858.36750-1-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190716071858.36750-1-Anson.Huang@nxp.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/07/2019 15:18:58+0800, Anson.Huang@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 IRQ using devm_rtc_allocate_device, and use rtc_register_device > to register the RTC device. > > Signed-off-by: Anson Huang > --- > 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