From patchwork Wed Apr 19 11:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Lanzhe X-Patchwork-Id: 675546 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 BAF7EC77B75 for ; Wed, 19 Apr 2023 11:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232988AbjDSLxX (ORCPT ); Wed, 19 Apr 2023 07:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232997AbjDSLxX (ORCPT ); Wed, 19 Apr 2023 07:53:23 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57298AF16; Wed, 19 Apr 2023 04:53:22 -0700 (PDT) Received: from localhost.localdomain ([10.21.35.93]) (user=u202212060@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33JBphtt020757-33JBphtu020757 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Apr 2023 19:52:05 +0800 From: Li Lanzhe To: Mark Brown , Heiko Stuebner , Chris Morgan , Jon Lin Cc: Li Lanzhe , Dongliang Mu , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: spi-rockchip: Fix missing unwind goto in rockchip_sfc_probe() Date: Wed, 19 Apr 2023 07:50:29 -0400 Message-Id: <20230419115030.6029-1-u202212060@hust.edu.cn> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-FEAS-AUTH-USER: u202212060@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org If devm_request_irq() fails, then we are directly return 'ret' without clk_disable_unprepare(sfc->clk) and clk_disable_unprepare(sfc->hclk). Fix this by changing direct return to a goto 'err_irq'. Fixes: 0b89fc0a367e ("spi: rockchip-sfc: add rockchip serial flash controller") Signed-off-by: Li Lanzhe Reviewed-by: Dongliang Mu --- The issue is found by static analysis and remains untested. --- drivers/spi/spi-rockchip-sfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index bd87d3c92dd3..69347b6bf60c 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -632,7 +632,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) if (ret) { dev_err(dev, "Failed to request irq\n"); - return ret; + goto err_irq; } ret = rockchip_sfc_init(sfc);