From patchwork Sun May 29 15:34:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 12864197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 411A2C433EF for ; Sun, 29 May 2022 15:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbiE2PjU (ORCPT ); Sun, 29 May 2022 11:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbiE2PjP (ORCPT ); Sun, 29 May 2022 11:39:15 -0400 Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4C5762CF4; Sun, 29 May 2022 08:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1653838741; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=daX12GWew3IwCy2KNmUXjEytC9BpO3UdZ4OA9NkkNJQ=; b=VkNQu0/8lYhufkUBrHbwvdLG1P4OU7QAocD+n+MvS9sCVDVAuHtVUDl0e+JILLhQ 3khGf4mMAU9jpkWQhePNdXUyU0f0XQz7RJoSWaZvOHoost6JFTXR8x8pI4zWfLvWy09 2c88LvaRZAvqQCA0KziiAk1HDoWXNzSmrGai4Wp0= Received: from localhost.localdomain (81.71.33.115 [81.71.33.115]) by mx.zoho.com.cn with SMTPS id 1653838739745377.08340585932433; Sun, 29 May 2022 23:38:59 +0800 (CST) From: Chengguang Xu To: netdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-scsi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org Cc: Chengguang Xu Message-ID: <20220529153456.4183738-5-cgxu519@mykernel.net> Subject: [PATCH 4/6] drm/exynos: fix missing resource cleanup in error case Date: Sun, 29 May 2022 23:34:54 +0800 X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220529153456.4183738-1-cgxu519@mykernel.net> References: <20220529153456.4183738-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Fix missing resource cleanup(when '(--i) == 0') for error case in gsc_runtime_resume(). Signed-off-by: Chengguang Xu --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 964dceb28c1e..68ea92742b06 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev) for (i = 0; i < ctx->num_clocks; i++) { ret = clk_prepare_enable(ctx->clocks[i]); if (ret) { - while (--i > 0) + while (--i >= 0) clk_disable_unprepare(ctx->clocks[i]); return ret; }