Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3345666pxv; Sun, 4 Jul 2021 16:09:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5+e9ogKVEeFBAhDodzRiC6kfbknLxM+xJd5i+McSWo43ybt/6j5RirwmNTBRaB7PnS6Fl X-Received: by 2002:a05:6602:2cce:: with SMTP id j14mr8792363iow.159.1625440177908; Sun, 04 Jul 2021 16:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625440177; cv=none; d=google.com; s=arc-20160816; b=dUrlBVt48Bq5iKpMkCE/VXIqIhRuWLIPrA4jR3RxIW2FnyK0Xw96rutwQxRezEMwB7 WUd8YqPRXGnA2eTNYcmy8FeKf32zEAV6UmiWJ3AcxpyfWCUfRFcxrtSlEBqiCxNLYwxX G9fYFnbXrUIajzz7p/tsus/2kULeWM8kZV3pNpV03pxgT7nIHx00da1GLTE188nM/8LZ SWZ8zYuW2od91LUnRI5aAxT5+WgMz8zzHYrFHbJHIZETRRBFYprs8iYX5aGwrbSCITf4 dhCKvS9K3A0017Ld2+V1SYRoSb+Ty0rwdegfEIH0emE5yiCBMUPkFi+I0sggg9sYmbqA LcDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P3PZz7z/jSHfa73B4mkADlugnDD1tBnMftdtFV3jpp8=; b=UloRBXSxslKrE/GKeuEzOwHwjyHaz2m5OkvdNWZPwiMUy5YvRs/nTL2SjmvSXil+oR nBzFCZz4jTtITdlRmslgWpgJTjcTiQ5Fv7oi6FZiwp+mFUFTYwdWIywaK9u7sAQQS3Ml b0WYF8qIry1OvdRE+cUP777IOU7LJ4LWPu2aD0uKD4Lc5wJgDa5C0mqEJTep8wtInQo5 NUNV97gOc1HiWdQ5o3g1j3ZhCKb/iiNrvpqQ2apX4XvKfXVF+pQqjnK5EGzEc1NmsDph 0ireSONVsvjJTuRUVk9qUyBo4tv8AMsyZsYWHmEzTDk8kLd1UroTvRG/C1A7frhu0aNk dU5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FPDss1lE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r22si11520566jai.72.2021.07.04.16.09.26; Sun, 04 Jul 2021 16:09:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FPDss1lE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232356AbhGDXLU (ORCPT + 99 others); Sun, 4 Jul 2021 19:11:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:48840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbhGDXKF (ORCPT ); Sun, 4 Jul 2021 19:10:05 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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