From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BE39C04A94 for ; Sun, 30 Jul 2023 11:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Zv6TlMF3zNEyuOxpoSsBF4pHDWhV3ys1oJs0vFyhXBA=; b=NaLBOwmghHnThu uTC4mZ9X0DfRdQ9Vr6HcbxNK4vOG97mxtdJSVdQnPY19d3hPEQ7WdbKHNlMfL8Cd39nOzNPLiTZfU kITQZ5atR5521MjwRA6RMwvrSxWbNs6r6hSNd5gMsz15xc1m3pKfdtZDGIHT35d5uojDPyQK5iviQ FkaHS0q6qeZ9QTKIv7CuInejmz27E8kt/egRQXWmV0O9wb61AZfTfb6m1gX8CT1wnFG0wXTCwbIl0 C6bohfTm5PDn3a42QqGRoSyUM3LfszJBQYT432b2bo5WkrFx/Avf7XduAAH0+6VD3s1HHAB3aHqPj 7v+WlZDHoaQmN980aXUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQ50V-00BGP1-2W; Sun, 30 Jul 2023 11:54:43 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQ50T-00BGON-0G for linux-arm-kernel@lists.infradead.org; Sun, 30 Jul 2023 11:54:42 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BA40360C19; Sun, 30 Jul 2023 11:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE6A4C433C8; Sun, 30 Jul 2023 11:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690718079; bh=h8Bvd9Q9O5xEzuY+S6AbRK4A8J3G/3ih916psi4y4Mw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aakay1r0mgVUNYwWeOi5r4R712O1sc2xu15UTf1h++oj3ZC+BYFuY+Hsd4IqCWJGR Pxb15jQ+Pio9tesL6UQSleR4PFiPC2Av06upYAcAbsVlnxwOgEQArRW/AipK1uR2Uh 280oAuEahqPoj+wjQ2ShAnmj4GgIQ+tcFcvSL7G0= Date: Sun, 30 Jul 2023 13:54:36 +0200 From: Greg KH To: Zhang Shurong Cc: patrice.chotard@foss.st.com, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: st-asc: Fix to check return value of platform_get_irq() in asc_init_port() Message-ID: <2023073028-pantyhose-replace-b960@gregkh> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230730_045441_186246_B18CA509 X-CRM114-Status: GOOD ( 19.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Jul 23, 2023 at 12:28:47PM +0800, Zhang Shurong wrote: > The platform_get_irq might be failed and return a negative result. So > there should have an error handling code. > > Fixed this by adding an error handling code. > > Fixes: c4b058560762 ("serial:st-asc: Add ST ASC driver.") > Signed-off-by: Zhang Shurong > --- > drivers/tty/serial/st-asc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c > index aa471c9c24d9..2f1807fa9bdb 100644 > --- a/drivers/tty/serial/st-asc.c > +++ b/drivers/tty/serial/st-asc.c > @@ -688,9 +688,13 @@ static int asc_init_port(struct asc_port *ascport, > port->ops = &asc_uart_ops; > port->fifosize = ASC_FIFO_SIZE; > port->dev = &pdev->dev; > - port->irq = platform_get_irq(pdev, 0); > port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_ST_ASC_CONSOLE); > > + ret = platform_get_irq(pdev, 0); > + if (ret < 0) > + return ret; > + port->irq = ret; > + > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > port->membase = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(port->membase)) > -- > 2.41.0 > Does not apply to my tty-next tree :( _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel