Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3345072pxv; Sun, 4 Jul 2021 16:08:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgV462SPzuBDs5E/cxAKCN5EJu2N/brWG9wBqzBymY3dhNwIQ3JJTMA8VMEPwwu5FLWxwr X-Received: by 2002:a92:364f:: with SMTP id d15mr8470087ilf.26.1625440106038; Sun, 04 Jul 2021 16:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625440106; cv=none; d=google.com; s=arc-20160816; b=Q+Xfg2HxzpljVj/3DXY8Fvt5i7C0aUYYOvMcqp84aHJ2gDMm/Sb+MwAwXy9ys63MTK W6k6r4wgexF3p9oBEAwwW43po87UO6TT6L5Q59GGK9VcDf39klhXl4uKHAaQPdFjw53h 1F3fZQucdGyUcb4FcCGqkg9DEMLNn21d6hhqkq4/3QY/ecoe61ATr34I8fByAMbcmvO6 IlKR7FkxFRs+YJIJJvokBve6x1eREcsTYnx2r9MTE5fV9rdDvhiLvKaEDIi/P0l02Lxr FROJP9qFUEVNYJ0CjxbE+MKLgcHGfzt0Cpo4lvfxm7CwDIHyS2qaw8dusJHVp3H0RMIH oeDw== 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=g0qJdRv2PiGJoY23e2uvjrZ6zNE1rfWCet5E7jBhFgOkS9IS7QBgFkj9gNtSNe1HJk HVqf27Uz+RlJN48XPC+vPq4zoquE0pvxfv5tNhxBaBY33VdsrVwRw/JLyy0+Pa1uRlKY wV7uCUPLN6C3iiN1tUyLfZecUG9DWzDIrxUpAKnEtzUBXg3QWHsgqjwWILWTyFGDRLg1 OCExcwkiIX9euG7eSok8kR2InozryW8U7h1flTzuCTTqJxevMI0q8n8T4fuMET0NsT1H G16MDBVXV7UXhBEBXLRe14sdRf35rcVpd9k0k20Gkhf3sA9NVpMMCCy2f3E9GtEFC7tT yfhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i94k7seW; 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 k7si11048703ili.32.2021.07.04.16.08.14; Sun, 04 Jul 2021 16:08:26 -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=i94k7seW; 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 S231470AbhGDXIu (ORCPT + 99 others); Sun, 4 Jul 2021 19:08:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:47080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbhGDXIM (ORCPT ); Sun, 4 Jul 2021 19:08:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 22BC0613F3; Sun, 4 Jul 2021 23:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439936; bh=svsv6M47GusGxdoHHlZTnG/iyReb7Lr39eIxDeEHyp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i94k7seWmvmq6MIpa32K9J+S8oOIdSjPYMwSgQ/tQiuV10iFdXUd8j3Q6zzUKjZZs tVPS7x0NFNwLat8PfEacsTgBhjk8glgyok4ucQYH2lPQXk3RrlVFg3zhvLkplz6Vrx rAdrhMz2nCxkgHnvwEj6ItmXRNIh2++bCRyronJKYeu3GhkKBQmANM+7H/+aOID6zy 8LIl40P5iBvD9G4dNVix4Q9jA0HuFLVicq6jtpRyoWolpb9ZTEweqVjrnYVSd+9+Zg wATZFs+rYNWsn/bQTGutS9/HVZPTMjrKLwAufCBSjCmTyRmSIlChlKAEMZxrxRg2BB ysGRroKysQOmQ== 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.13 55/85] spi: meson-spicc: fix a wrong goto jump for avoiding memory leak. Date: Sun, 4 Jul 2021 19:03:50 -0400 Message-Id: <20210704230420.1488358-55-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230420.1488358-1-sashal@kernel.org> References: <20210704230420.1488358-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