Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1642503ybk; Mon, 11 May 2020 00:24:00 -0700 (PDT) X-Google-Smtp-Source: APiQypJqh63GKrrYevDkonuiMEAn/RxTk/1m/SsDU3aM8rPCxstYGo75xkFk20DqYGC+TejJHywM X-Received: by 2002:a05:6402:1d37:: with SMTP id dh23mr11955351edb.287.1589181840654; Mon, 11 May 2020 00:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589181840; cv=none; d=google.com; s=arc-20160816; b=qL2p4c28XxdndBMlG9IZV4rqOAoNFmA1IOkNIcdqPqluEPbIbWRhpdIIxraCCPh6GL 3Y9n/4Eqw84jgCWb6fhDQEoZps8MSnnvPzcusTrRlqTr8pY32fKwiLZBfTzbfqjlcKAd VZI6nRW4gF2cbRlYHt0rw5Hv31pFttDs0Y7brGYzD6OnN5DruXVcC71W0M0iE7+E0Jlx 6NinnQLNK/DeQSIGnWITf2m5ialgriCYCPcI1lEeZY+O8xU5DrgqOPFL3qto49JYz0iR xFKLrE/us91rOGGIWNXgrQt3HACjbwwR2XHb8n1azl7SgAl1ARz1URo0aFPKJd3vlZWV 8Tuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=sKU3oZkmr8qulLGsUGTcJDc2ZpB8HvH9UyQPzPArtoE=; b=rnJIlvAumWKzYxrr1LP9cfk1vrCQByMDbwBfrJRglwEEy8/hsLJuodTQ1c+uwc5aQ2 lqEuDKR8pTe3UVaNN743GcOcA10y3+xb9Gd4fvCXvXW4+ngVfs3DLYo8SPxIOMA2VyVC 5qpjcH1DeAR1P2qFsWtxLM+1nbDpkGm4JKYbhET6lpupDy1CABTNp/ixY5cGGQJfePRe HV0LCzXgYr18EGRjo6OxdAglIU/XAqPajF9VNofgf5LaZUxW5ODiTVGmoUcZf2Uw/ury BEVi88mwGFN7F2jmIZ44tUXWEb2VHKPsT1VmkHIC2p+Os5Wku+AFIikNP8oeea/4Kpxn Rmkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si1708889eda.480.2020.05.11.00.23.37; Mon, 11 May 2020 00:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbgEKHTU (ORCPT + 99 others); Mon, 11 May 2020 03:19:20 -0400 Received: from inva021.nxp.com ([92.121.34.21]:36304 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbgEKHTU (ORCPT ); Mon, 11 May 2020 03:19:20 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A9E17201518; Mon, 11 May 2020 09:19:18 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 80C27200AD7; Mon, 11 May 2020 09:19:14 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5F904402E1; Mon, 11 May 2020 15:19:09 +0800 (SGT) From: Anson Huang To: gregkh@linuxfoundation.org, jslaby@suse.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] tty: serial: imx: Add return value check for platform_get_irq() Date: Mon, 11 May 2020 15:09:56 +0800 Message-Id: <1589180996-618-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RX irq is required, so add return value check for platform_get_irq(). Signed-off-by: Anson Huang --- drivers/tty/serial/imx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index f4d6810..f4023d9 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2252,6 +2252,8 @@ static int imx_uart_probe(struct platform_device *pdev) return PTR_ERR(base); rxirq = platform_get_irq(pdev, 0); + if (rxirq < 0) + return rxirq; txirq = platform_get_irq_optional(pdev, 1); rtsirq = platform_get_irq_optional(pdev, 2); -- 2.7.4