Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1940392pxu; Sun, 13 Dec 2020 08:14:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwq6or5xsioWLQVI6TbGFcN1+mUifWkVdyL2S4OROoq2ODr+VR+fgXiV4e6mKZ9D9lzATKB X-Received: by 2002:a17:906:12d3:: with SMTP id l19mr19011869ejb.65.1607876048234; Sun, 13 Dec 2020 08:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607876048; cv=none; d=google.com; s=arc-20160816; b=XLjODuhAmKwBOpq44VFaxzVfqun6ohA52/hSMkkdXNSzonPSTClAb1eRP8+PqHT8Hh at3kE9RWrW1tgcs2yIMGUuh4ZscqIzvq/FGMmX24aVjzMfrxii4pfatCKv/PkyEX5Kbf eTGukHQjCjHFKHED79pMPnyAW7TDMJFaBQG3SS+0A/qd4Tc58Ouz6PONtlAp6dEueMZl J3kzH6Nw5OaT5Bi3LDUPEXcLYH7Bs6kFhhXtKgqoBR7W5vVgHduxn2l2hk+4bx2YbM8J srRETiuzEF5NrmW+7KlB9NasWo8KFpi7bgplFk3WDY/AYKRrglyVtz3sEVVRBKNAVBSy hveQ== 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; bh=rCrlKrtIGirYfb1ub4smq/iERph9GgkcUbvgkhtzQqM=; b=MSikKFveAXSmaAi8VcTQ1GHTuShnt7mbs+6taMTqge5SQHEBCc1psvOiuEwqpU+CFY 5oExqAnktBETC3xfAs3lEPzwX8hZg7H51YNZvMVyLUiV2uwiddG3Ijl9L3vhTD3x+O3m owNpbOPf9+LMWMpWx8cRH8va0cLNgZcY0Po6jzkiJa5Kgto0gcpTxtvRVFR2y7SxKdSe tePEIfOM/IIUUB36baYYU9VrV1dUvoAVAOtm0lbPa4IvM/Yv3ariccaSLN1LJla1CbrY 2sGxm+ZP3jei+3Rfeavju9OAhfK6ZYJjObaMBC3zFACLlSZ/DTRt+6g2b+UvWbsIcsnb x1uw== ARC-Authentication-Results: i=1; mx.google.com; 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 j23si8461110eja.53.2020.12.13.08.13.45; Sun, 13 Dec 2020 08:14:08 -0800 (PST) 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; 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 S2407665AbgLLQhm (ORCPT + 99 others); Sat, 12 Dec 2020 11:37:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:57718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439374AbgLLQJg (ORCPT ); Sat, 12 Dec 2020 11:09:36 -0500 From: Sasha Levin Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Qinglang Miao , Thierry Reding , Sasha Levin , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.9 08/23] drm/tegra: sor: Disable clocks on error in tegra_sor_init() Date: Sat, 12 Dec 2020 11:07:49 -0500 Message-Id: <20201212160804.2334982-8-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201212160804.2334982-1-sashal@kernel.org> References: <20201212160804.2334982-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: Qinglang Miao [ Upstream commit bf3a3cdcad40e5928a22ea0fd200d17fd6d6308d ] Fix the missing clk_disable_unprepare() before return from tegra_sor_init() in the error handling case. Signed-off-by: Qinglang Miao Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/gpu/drm/tegra/sor.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index f2a114f14a3db..b83a46df00584 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -3143,6 +3143,7 @@ static int tegra_sor_init(struct host1x_client *client) if (err < 0) { dev_err(sor->dev, "failed to deassert SOR reset: %d\n", err); + clk_disable_unprepare(sor->clk); return err; } @@ -3150,12 +3151,17 @@ static int tegra_sor_init(struct host1x_client *client) } err = clk_prepare_enable(sor->clk_safe); - if (err < 0) + if (err < 0) { + clk_disable_unprepare(sor->clk); return err; + } err = clk_prepare_enable(sor->clk_dp); - if (err < 0) + if (err < 0) { + clk_disable_unprepare(sor->clk_safe); + clk_disable_unprepare(sor->clk); return err; + } return 0; } -- 2.27.0