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: 9592245 X-Patchwork-Delegate: agross@codeaurora.org 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 1DA0A604A2 for ; Sun, 26 Feb 2017 07:55:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E990828488 for ; Sun, 26 Feb 2017 07:55:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA39D28490; Sun, 26 Feb 2017 07:55:06 +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=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6D1428488 for ; Sun, 26 Feb 2017 07:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbdBZHzC (ORCPT ); Sun, 26 Feb 2017 02:55:02 -0500 Received: from smtp10.smtpout.orange.fr ([80.12.242.132]:35152 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbdBZHzC (ORCPT ); Sun, 26 Feb 2017 02:55:02 -0500 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 Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET 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 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 Reviewed-by: Rob Clark --- 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; }