From patchwork Sat Jul 15 09:53:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Shurong X-Patchwork-Id: 704009 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C313EB64DC for ; Sat, 15 Jul 2023 10:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229436AbjGOKAP (ORCPT ); Sat, 15 Jul 2023 06:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjGOKAO (ORCPT ); Sat, 15 Jul 2023 06:00:14 -0400 Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10EE6132; Sat, 15 Jul 2023 03:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1689415209; bh=UpVM55kDs942KIyIZCbP7/8cjNZBSlpLjQ3vWtUWbAI=; h=From:To:Cc:Subject:Date; b=mjrS4xN36G6gqCuJ+K2TGaUmS9VWkkkW0bMCmGq9tRO/aevaEki1OQKtG8Q2O1nMa O7yolZhUOZg+/3uDTF54Mnj/jOxlLaK65DzIfmrO6mmOIqYANJ/lvlEAUF8ACvhJ3U KRRxk6Ntsrmv4gJUOOpJJmss/lRFDopL641hN9oM= Received: from KernelDevBox.byted.org ([180.184.49.4]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id D792BC5A; Sat, 15 Jul 2023 17:53:57 +0800 X-QQ-mid: xmsmtpt1689414837tvr97vcsh Message-ID: X-QQ-XMAILINFO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X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk= From: Zhang Shurong To: ldewangan@nvidia.com Cc: broonie@kernel.org, thierry.reding@gmail.com, jonathanh@nvidia.com, p.zabel@pengutronix.de, linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Shurong Subject: [PATCH] spi: tegra20-sflash: Fix signedness bug in tegra_sflash_probe Date: Sat, 15 Jul 2023 17:53:56 +0800 X-OQ-MSGID: <20230715095356.1507787-1-zhang_shurong@foxmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org The "tsd->irq" variable is unsigned so this error handling code will not work. Fix this by adding error handling statement Fixes: 8528547bcc33 ("spi: tegra: add spi driver for sflash controller") Signed-off-by: Zhang Shurong --- 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 4286310628a2..4c18337de813 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) {