Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2933725rwb; Mon, 15 Aug 2022 14:20:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uyV2kFfsfvs+GZd4ROmZz87ZqTMuoc0hDbf2SuTRIJI9YDnzlxSdZxMQb22nqQwbeGQZG X-Received: by 2002:a05:6402:2387:b0:43d:3e0:4daf with SMTP id j7-20020a056402238700b0043d03e04dafmr16130416eda.208.1660598426479; Mon, 15 Aug 2022 14:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598426; cv=none; d=google.com; s=arc-20160816; b=mkp/Oi2kl9KmoMX7bzPso9i4ieWQkfy/c21BblChxPtVoywVo/6UwGSiykVh8wnbj2 xpjLSf4Hr2/mq4xoQo9GolVPnmNTHiyOF9FPv+EVDrD/KLQwk7P7WIQxERfST2ABIW/g F4kilwhs1McOaDG695P3kCwCJBMQmKioOINWXhjDPlyID6NTAEOV8STS7Suk3Egwj5s7 26leM8rEsxq/vmNgYyvnf9eHbInrAaUOFXrAfXVRn0lueenZ8healwKnEm6Uy7kpE22O YOdZeT1a4t8FmXOFqP+aeg6B9F0SCZRb9RsMyDV155pFYOXrTT3Ud5Mbe/n/f9YVgjVg yXRw== 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=Xb6bL0TDDqkgdgSF3mCUplILP3QFewkAtnmP7WJbvK0=; b=hHuF6rgbUYFUXwcEfz84O71HLTHqmR/pdvq6r5r5ZUBSbZO3vNhT1tlXq6ZXBWPeW7 6q604looK4yXwMl6z7bRLas3hUdm2T7AmtG/dqK3bwEcbzf8n1Uw9ShcilFYcxo/s1cm 7NGulNa8qDe7jQsLhoKAL1B3O6s23HjGUA84LZlo0yriNj7XRQcrUbEjUXU53C632+LG tEnQpuvWUT8q8jBVgZgvH+XG7fGMwpMlNjWeJoIDUZVcOS1MMy1JdZPx3aRgrF/FUBf2 A9JIMLDZiPTrqhb83w9Q1XoDBvC/lYc9J5jh3+uls4LhDxqWECWsVGJR8OHV161KRww2 V+rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PvakoKGe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa24-20020a1709076d1800b007318692f59csi8547491ejc.935.2022.08.15.14.19.59; Mon, 15 Aug 2022 14:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PvakoKGe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S243448AbiHOVPj (ORCPT + 99 others); Mon, 15 Aug 2022 17:15:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347989AbiHOVHx (ORCPT ); Mon, 15 Aug 2022 17:07:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 896FB3B971; Mon, 15 Aug 2022 12:17:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 44643B810A3; Mon, 15 Aug 2022 19:17:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 773D6C433C1; Mon, 15 Aug 2022 19:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591039; bh=h/PfWu7Xr8kqLVrdH1TS0WY7MGdiEQCDXRo1umr4zv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PvakoKGeBlUfL3ScuF4KI/POHi5Ha1cPWejspiaocPWdJdz0DD+gTQqIfqLoRAmrh Fh7d4Ut/bKddzUmCm8gcL2nL/o36a9j3JyrycEYWnPUkHaKR1B0H1mw4klj07IYg7q XRs23bxpY4nzwqH2cNKIQBd3SzFHZ1dGfsakBT+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Jian Zhang , Inki Dae , Sasha Levin Subject: [PATCH 5.18 0452/1095] drm/exynos/exynos7_drm_decon: free resources when clk_set_parent() failed. Date: Mon, 15 Aug 2022 19:57:31 +0200 Message-Id: <20220815180448.329093478@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Zhang [ Upstream commit 48b927770f8ad3f8cf4a024a552abf272af9f592 ] In exynos7_decon_resume, When it fails, we must use clk_disable_unprepare() to free resource that have been used. Fixes: 6f83d20838c09 ("drm/exynos: use DRM_DEV_ERROR to print out error message") Reported-by: Hulk Robot Signed-off-by: Jian Zhang Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index c04264f70ad1..3c31405600f0 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -800,31 +800,40 @@ static int exynos7_decon_resume(struct device *dev) if (ret < 0) { DRM_DEV_ERROR(dev, "Failed to prepare_enable the pclk [%d]\n", ret); - return ret; + goto err_pclk_enable; } ret = clk_prepare_enable(ctx->aclk); if (ret < 0) { DRM_DEV_ERROR(dev, "Failed to prepare_enable the aclk [%d]\n", ret); - return ret; + goto err_aclk_enable; } ret = clk_prepare_enable(ctx->eclk); if (ret < 0) { DRM_DEV_ERROR(dev, "Failed to prepare_enable the eclk [%d]\n", ret); - return ret; + goto err_eclk_enable; } ret = clk_prepare_enable(ctx->vclk); if (ret < 0) { DRM_DEV_ERROR(dev, "Failed to prepare_enable the vclk [%d]\n", ret); - return ret; + goto err_vclk_enable; } return 0; + +err_vclk_enable: + clk_disable_unprepare(ctx->eclk); +err_eclk_enable: + clk_disable_unprepare(ctx->aclk); +err_aclk_enable: + clk_disable_unprepare(ctx->pclk); +err_pclk_enable: + return ret; } #endif -- 2.35.1