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 84A1ECD13D3 for ; Mon, 18 Sep 2023 07:56:38 +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=+/ptmNCWaX70jnbxHbYgRdh2ik9lFBWA/Hz42Fb9pSg=; b=AmB5xY7WqF6uX5 0z7bzu6qDDj64ZxN021tBEx/bgiBfeW6FqZzlYzM2lQeMn8CaD7vNLkpeY0aHPvGdmQbVjGHq5S8r H7gMLwKpLCdveOOzsIdnasBK4o4fedpjVlYIOAMyDTZbngjAzAnj66W0Khyzg/1ETUIqf0Reph8wU X1OJ0ZTPXTTZExLBalPei9Qsksxubi/7Wfk6LehVEbsySJo5b670w9eXGnHJBuadPz3enfNJqT9k2 +ZGcExl5w0wHxazJUjJbeMbV+Af3Ow8G3yN3XGAMP5/aM8h8zlId1Nk58+TibLL45LY0+aJJyr4/m VZbUHsrLlFDK7cLTbqSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qi975-00En7d-10; Mon, 18 Sep 2023 07:56:11 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qi96z-00En6U-0r for linux-arm-kernel@lists.infradead.org; Mon, 18 Sep 2023 07:56:10 +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 sin.source.kernel.org (Postfix) with ESMTPS id 4A9C3CE0C4F; Mon, 18 Sep 2023 07:56:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 434C0C433C9; Mon, 18 Sep 2023 07:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695023761; bh=LxrT4DjTJ8KTCe3CTiQGS6Js7PzesfHyt4s8YnU5JSE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XQqPCAFzllF9KAuDQlKVMnSIGX1iWq6y/clSyozwFbqVn7Sif/WSt35flcSi0T+4F koMrnvyuYZvcW2BXBuY63/CMKEpDZuHaATfFytKlG4GnxklGIK9b0wRzzzqOSODKCH pmhWhbf3mXx1dK5+wf1gRZVeOd20eAIu4vDTM9gM= Date: Mon, 18 Sep 2023 09:55:56 +0200 From: Greg KH To: Zhang Shurong Cc: patrice.chotard@st.com, jslaby@suse.com, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] serial: st-asc: Fix to check return value of platform_get_irq() in asc_init_port() Message-ID: <2023091849-chill-haziness-1a35@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-20230918_005605_501055_3EE06FCE X-CRM114-Status: GOOD ( 20.01 ) 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 Sat, Aug 26, 2023 at 03:54:59PM +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 > --- > v1->v2: generated patch based on tty-next tree. > > 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 e7048515a79c..3d60ab6e9581 100644 > --- a/drivers/tty/serial/st-asc.c > +++ b/drivers/tty/serial/st-asc.c > @@ -723,9 +723,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.30.2 > Does not apply to 6.6-rc2 :( _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel