From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 481BA1170E for ; Mon, 11 Sep 2023 13:55:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBEEBC433C8; Mon, 11 Sep 2023 13:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694440540; bh=dnQujpoQzgpG/mXnsVgaYhVxN8FluSTOaNZzYz5au2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cd1S6BncQC7brL2gj9xhvKVgKkDld/KLZzgoGcTmUZzJaVmGWDFWW8ABZrUqEbugS KqmQcaNIdvcirFvEFkr+GsEuKYdVizzekoZm5FfTKJJwpWqInvWY9ZXpH/sHQg7cMD Koa7a8Y2zr33dSenroLirp6L0kapiczfMyhP1W+k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhang Shurong , Mark Brown , Sasha Levin Subject: [PATCH 6.5 097/739] spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() Date: Mon, 11 Sep 2023 15:38:16 +0200 Message-ID: <20230911134653.810386900@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.921299741@linuxfoundation.org> References: <20230911134650.921299741@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhang Shurong [ Upstream commit 29a449e765ff70a5bd533be94babb6d36985d096 ] 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: 8528547bcc33 ("spi: tegra: add spi driver for sflash controller") Signed-off-by: Zhang Shurong Link: https://lore.kernel.org/r/tencent_71FC162D589E4788C2152AAC84CD8D5C6D06@qq.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-tegra20-sflash.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index 4286310628a2b..0c5507473f972 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -455,7 +455,11 @@ static int tegra_sflash_probe(struct platform_device *pdev) goto exit_free_master; } - tsd->irq = platform_get_irq(pdev, 0); + ret = platform_get_irq(pdev, 0); + if (ret < 0) + goto exit_free_master; + tsd->irq = ret; + ret = request_irq(tsd->irq, tegra_sflash_isr, 0, dev_name(&pdev->dev), tsd); if (ret < 0) { -- 2.40.1