From patchwork Sun Feb 26 07:52:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9592711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DDE1604AB for ; Mon, 27 Feb 2017 05:15:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0074627FB1 for ; Mon, 27 Feb 2017 05:15:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E82EE28375; Mon, 27 Feb 2017 05:15:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AC72827FB1 for ; Mon, 27 Feb 2017 05:15:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C2FA6E2CA; Mon, 27 Feb 2017 05:14:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.smtpout.orange.fr (smtp10.smtpout.orange.fr [80.12.242.132]) by gabe.freedesktop.org (Postfix) with ESMTPS id B03E56E16C for ; Sun, 26 Feb 2017 07:55:02 +0000 (UTC) Received: from localhost.localdomain ([92.140.162.61]) by mwinf5d33 with ME id pKuu1u00P1KnKiL03Kuv9e; Sun, 26 Feb 2017 08:54:59 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 26 Feb 2017 08:54:59 +0100 X-ME-IP: 92.140.162.61 From: Christophe JAILLET To: robdclark@gmail.com, airlied@linux.ie, architt@codeaurora.org, hali@codeaurora.org, yongjun_wei@trendmicro.com.cn Subject: [PATCH] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()' Date: Sun, 26 Feb 2017 08:52:06 +0100 Message-Id: <20170226075206.25762-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.9.3 X-Antivirus: avast! (VPS 170225-1, 25/02/2017), Outbound message X-Antivirus-Status: Clean X-Mailman-Approved-At: Mon, 27 Feb 2017 01:45:06 +0000 Cc: linux-arm-msm@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Christophe JAILLET , freedreno@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the clk already handled. With the current implemenatation, we try to do that on the clk that has triggered the error, which is a no-op, and leave 'msm_host->bus_clks[0]' untouched. Shift by one the index array to free resources correctly. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 1fc07ce24686..eac4987f3946 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -438,7 +438,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host) return 0; err: for (; i > 0; i--) - clk_disable_unprepare(msm_host->bus_clks[i]); + clk_disable_unprepare(msm_host->bus_clks[i-1]); return ret; }