Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9174896pxu; Mon, 28 Dec 2020 08:26:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzb//lDwoKeZzZ4vZaWBIa7qHN2Z0X2CkYyOvTAlGAN77s9gRQW9O1GsfvG9ewtxMqixQbA X-Received: by 2002:a17:906:adce:: with SMTP id lb14mr42071224ejb.502.1609172778423; Mon, 28 Dec 2020 08:26:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172778; cv=none; d=google.com; s=arc-20160816; b=h8KX6LbARSHfvUIUYsjxOCRBsFkuAExA6bVX4OcUmEqYQr5GrLpHO4ly02bK6/eRyO cBlhwcRAN+lF8uie1H7d8VyVf+kCNGB/koDgNaJhOiL8s98B9vterLnbwEwQSr7YDxlX KM2PTRhGZv3WgZDyElZEzF6F8O8D34Fo/JEeW0q7Ex4zRUThwiscT4YQILoTf24Z5pmJ GToa965TSMjfIUTOKjPAwZUd/urCZt8fJLRPDm6ZAX7FjKwkF47NKkl/ILzlRdmiaTJg XcSWGP+bVuLgU++luH0uSCvl8sJHc1PEsfR0ENiY+/vfPu/ZF6ZSLh88Qy5mGavGxdmH 3mdQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8XBqeNw/VXau1Mn2q4jHNjzO8nqJLHTGdkKLKLl8uTA=; b=eF/kZ+BVkU8nyNnxYlTO+opM3uaj8NTWvyI1TrLv3bMtm8E6gageTvP4Bk+4biTJR2 rxGv57Fm1EDwXN/pP886FIzQSPcUPSf50wuJLfHMrJS+mttJLmVpkA6aHM2BmpB1055L sVMxCbj0DCoWyAkMzXvKTUB0CE4fvWXLd4cBHPLy9SexGt22YeizivP/FZKqRQD7VouF UThJ+OwneTCEbNy/rwoOHAvjGQh0JE75cgqGFDMEpfkqZi6r5JZok+gxffjQ7AcH7DB5 x9zKQEO++91WBpwNlzh3VcCoAv3lCyvrKvL4WM4Ltdl35B9IzOcqgYCrUyx73MDfMcdo W5Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e7Z5dVdH; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce16si19652336ejb.245.2020.12.28.08.25.55; Mon, 28 Dec 2020 08:26:18 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e7Z5dVdH; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731817AbgL1NLk (ORCPT + 99 others); Mon, 28 Dec 2020 08:11:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:38820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731483AbgL1NLC (ORCPT ); Mon, 28 Dec 2020 08:11:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42BCC2076D; Mon, 28 Dec 2020 13:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161021; bh=e3mAGGGpbxSs7Un8er1DvHsBcDpuXcSYNhx/KPdubXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e7Z5dVdHt80Ys33DGr2FI6IXTFO85hDfYvN25MVXfM3QURL7IETkoefH/xzfL+3cQ HVDsHyZWbyrB+EjxdscHzaPMXFyv9YmKEzaKVCHlB7f9IRYBPh5Udf5oUSHv9ZVvDI Ex4q7apjT/E1KhQ4bDcVjVouLzvNogAkUT/Tkxak= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qinglang Miao , Thierry Reding , Sasha Levin Subject: [PATCH 4.14 043/242] drm/tegra: sor: Disable clocks on error in tegra_sor_init() Date: Mon, 28 Dec 2020 13:47:28 +0100 Message-Id: <20201228124906.797490959@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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: 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 7ab1d1dc7cd73..352ae52be3418 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -2378,17 +2378,23 @@ 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; } } 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