From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34A0FC07E95 for ; Sun, 4 Jul 2021 23:33:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2671613B9 for ; Sun, 4 Jul 2021 23:33:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2671613B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GJ8HPEi37SKpqA8Lo4S23vlNVhmvtr8dbLwZSo7NLCM=; b=LeriwX/lLEuFqb WMePuR3L/URBQVuD6JVzSTbn0+J+R8ODGGlzswXyyzSe0unEFTyx1EcgFIQq8TM1+LW4iYf6ZREd4 RTvVlOeMzhKyNHIP08EF71OVpkpu+SzGV89YJqc5P1N0SUyyZkjmIUn0vEUymkU3MmmkK7snMPlxv aVpoYQaSyElj1KTm6ZvH3RWpk83T3ojnMPPq2Gi5ELV6MEtkiUF7jpDkNuqbT65LD8oq5PkvgCuqS QxUR8/PZyZjUwCGEGI7nemH+3LZ40S0H7ac8Yu7p1LoHgT4sOGSbd5oXrLGZDTKYEpIftHybD5pY/ x0Lp5CAqgpvr14WA2McQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0BcC-00782Q-9N; Sun, 04 Jul 2021 23:33:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0BCx-006uXf-Jk; Sun, 04 Jul 2021 23:07:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 38BA9613F6; Sun, 4 Jul 2021 23:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625440047; bh=svsv6M47GusGxdoHHlZTnG/iyReb7Lr39eIxDeEHyp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FPDss1lESr5kxLTMV0G9UxnV9+wLCKogZ1oQ/EKPb4YkpXBRl+qnh2B3O9ZJxqnTW Oeg9/1SzrVY5CUAp9OS5Lxps0aH3Nh+JiZSnWQNnBbH948N+42lh0n++zuxhHsUCiO H+XAfxkl0BF/OMIDogkdlVCwsI5e/OBQyc4jVqxDm5/jYJGloTe+jwMMVgKtvyKPdg P/xXgijSEGgQpdaqzYv5n4qv4ae1WbB8+rN1YZq93EimULSoToqVwvlvv6KUZBaF+s PBhT0JvJUpddA8dZWGU2OdbqG1bLKIyOqX9IdXlq9cZBckRCvGJtRqATTRzd4OLQ27 YTO1sb81ZZs6Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: zpershuai , Neil Armstrong , Mark Brown , Sasha Levin , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [PATCH AUTOSEL 5.12 52/80] spi: meson-spicc: fix a wrong goto jump for avoiding memory leak. Date: Sun, 4 Jul 2021 19:05:48 -0400 Message-Id: <20210704230616.1489200-52-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230616.1489200-1-sashal@kernel.org> References: <20210704230616.1489200-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_160727_685036_AD0214E6 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org From: zpershuai [ Upstream commit 95730d5eb73170a6d225a9998c478be273598634 ] In meson_spifc_probe function, when enable the device pclk clock is error, it should use clk_disable_unprepare to release the core clock. Signed-off-by: zpershuai Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/1623562172-22056-1-git-send-email-zpershuai@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-meson-spicc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c index ecba6b4a5d85..51aef2c6e966 100644 --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -725,7 +725,7 @@ static int meson_spicc_probe(struct platform_device *pdev) ret = clk_prepare_enable(spicc->pclk); if (ret) { dev_err(&pdev->dev, "pclk clock enable failed\n"); - goto out_master; + goto out_core_clk; } device_reset_optional(&pdev->dev); @@ -764,9 +764,11 @@ static int meson_spicc_probe(struct platform_device *pdev) return 0; out_clk: - clk_disable_unprepare(spicc->core); clk_disable_unprepare(spicc->pclk); +out_core_clk: + clk_disable_unprepare(spicc->core); + out_master: spi_master_put(master); -- 2.30.2 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic