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 94DCA6FA7 for ; Sun, 17 Sep 2023 19:22:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE4B2C433C8; Sun, 17 Sep 2023 19:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694978545; bh=26VnrdFhRA3LrWDAJiJJr01QZQLJEfZxCiMkCcBm5U8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NhnJJpysmlbwcDzfYBvkwG6rs7j/k2QppWNqp3BF6+n4uJjg4PDmKpwfRn71wU4y3 znAYplkAQQHSiYkz88AwQl6PY+2EdXDMhBV9XwHfmE4TUoxc9ePP/PmYab2Ge3AI1f 3FozaZ1uVnSZFawpe84g9ZxjgQY4sTnM4ijv98fo= 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 5.10 090/406] spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() Date: Sun, 17 Sep 2023 21:09:04 +0200 Message-ID: <20230917191103.507289011@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230917191101.035638219@linuxfoundation.org> References: <20230917191101.035638219@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 5.10-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 cfb7de7379376..62e50830b7f95 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -456,7 +456,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