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 7375DC4332F for ; Wed, 24 Nov 2021 12:28:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245234AbhKXMbe (ORCPT ); Wed, 24 Nov 2021 07:31:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:36482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242718AbhKXMUw (ORCPT ); Wed, 24 Nov 2021 07:20:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1884A610E6; Wed, 24 Nov 2021 12:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637755970; bh=dpabKzcxBb2yn8fpXJLncwcTVdvfQsaPMiNVm1wfaGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTziDBd20YvsOVrivsCwibLw1HN8vmFhLpMFacl2UOQst4KLKkULfkaE4HYb2KV0v N/yE7+uTDW/lJQsZFS5chdLEito9lEzXvE5QdMC+G0YtXUDPltE22xzvbA62kP65O5 Cb6dEnlYVvwxbSlpv3aZsl1Vgp/IgiXRBsVTUrlE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Jon Hunter , Thierry Reding , Sasha Levin Subject: [PATCH 4.9 121/207] soc/tegra: Fix an error handling path in tegra_powergate_power_up() Date: Wed, 24 Nov 2021 12:56:32 +0100 Message-Id: <20211124115707.973975958@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115703.941380739@linuxfoundation.org> References: <20211124115703.941380739@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 986b5094708e508baa452a23ffe809870934a7df ] If an error occurs after a successful tegra_powergate_enable_clocks() call, it must be undone by a tegra_powergate_disable_clocks() call, as already done in the below and above error handling paths of this function. Update the 'goto' to branch at the correct place of the error handling path. Fixes: a38045121bf4 ("soc/tegra: pmc: Add generic PM domain support") Signed-off-by: Christophe JAILLET Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/soc/tegra/pmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index a12710c917a14..cb2ef789263b7 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -396,7 +396,7 @@ static int tegra_powergate_power_up(struct tegra_powergate *pg, err = tegra_powergate_reset_deassert(pg); if (err) - goto powergate_off; + goto disable_clks; usleep_range(10, 20); -- 2.33.0