Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp914254pxx; Thu, 29 Oct 2020 18:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+oobpq4jHowUQQDW/5juRhJEmZf2X9hGzvDlKC2MTctREaIf7UpbKRDF7764KGu/qUIcT X-Received: by 2002:a50:cfcd:: with SMTP id i13mr6794590edk.275.1604021539612; Thu, 29 Oct 2020 18:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604021539; cv=none; d=google.com; s=arc-20160816; b=YlnWkSErQitVVAecHAqYmY9taLTsLPtIvI/bWEAsC1ZHaTq4zuG12XuEPfSmwVPRLq G+4LJHUTwHDnEyuls5VUNftvWfaXmeI4BppUUcp4eZ666bDKTGdHLrE0WfWJCgJooIBu 2/kckBdXYtxxCpjE7zSkZXcVSSRci8N2os2wxUU28kcYO4+aCTn1fce6D50nab9m7TKB 8gcYdyh+aCWAlrPME7VfbHvC4Dvo9z7iuiGDj1LvXKQyESbRwspL8XB6JLlA9f/8CEVZ wFZbjkNhexaGlg80HiAjvzrG8VPkd7Z7BVp78V6exi5k98eSVEc08qkhLDxxPzd5Jeh7 l/MA== 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 :message-id:date:subject:cc:to:from; bh=Qz5lxT2I7pftcZ6Rq2Un8dO99gk/k0MYU/Q0v1xLMS0=; b=U49wehG1re8jpoZunvyTb4zO/WmrlXBI0/UdqvTG1QLdQof+ll8T+5of3uWHCY+9c9 JZlokBR+/bnMIwhsRPe5h3viMcTBXu6wFiqxcZ+XuU0Jlfzj32z2cRLqNYFk2EBxfrjB qLtHfI87QdAwUMLjXI+lfZc+uqv8KFu4DvObvqEEcvr9SjSFfo99b48JGdphMY5vAScu vHCUWcpTsRL0pqMW2FYgttYel2mLqkEic6RUAixP/Z3pLHISXkVczjSQpn3gTtdW56pc wHt++olscktCkl2a5yi4WqPtbKy/wfdGOjQOvonqs2i0+8vZKJKt1MI54qzApAlWuLE4 Ipzw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu8si4005310edb.95.2020.10.29.18.31.56; Thu, 29 Oct 2020 18:32:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbgJ3B2p (ORCPT + 99 others); Thu, 29 Oct 2020 21:28:45 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:6934 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbgJ3B2o (ORCPT ); Thu, 29 Oct 2020 21:28:44 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CMl7w4RQpz70H1; Fri, 30 Oct 2020 09:28:44 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 30 Oct 2020 09:28:33 +0800 From: Qinglang Miao To: Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter CC: , , , Qinglang Miao Subject: [PATCH] drm/tegra: sor: fix missing clk_disable_unprepare() on error in tegra_sor_init Date: Fri, 30 Oct 2020 09:34:24 +0800 Message-ID: <20201030013424.53995-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the missing clk_disable_unprepare() before return from tegra_sor_init() in the error handling case. Signed-off-by: Qinglang Miao --- 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 e88a17c29..0103e8c16 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -3145,6 +3145,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; } @@ -3152,12 +3153,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.23.0