Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2136549iof; Tue, 7 Jun 2022 20:58:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6qkSgxBgOKE64qj8nJjsMgiVFK0W3ksJubHdE1qEyvg4HSNg8FpLs9E0TvSXZKivNHhon X-Received: by 2002:a17:90b:3b8a:b0:1e2:ee1e:6340 with SMTP id pc10-20020a17090b3b8a00b001e2ee1e6340mr35494006pjb.38.1654660738478; Tue, 07 Jun 2022 20:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654660738; cv=none; d=google.com; s=arc-20160816; b=YjVzQjE2obKBeURhLhVio0eYrZJEXyK6+DPx7bLTU/cogmQw5ICF5cD1WB+xPX61+n 1Dy3fAlDjilVn6y9DFLrHCtXAf4n+bJ3NKQqixMCPOcqV8kJLyvq07H1Q6aaTTSdBvv9 bwevUDs83MdNTGAH7DvJ2GTv7O+OIcjzhfEGg0o2M8jSHK0XvqNTb07qIAhxS4j0pBrH 6TRqu2TNoeansjdguRB/7TAJ985AqgqoPcLg5rHUpVFijALMojbE9sA63n8+MHlP/Si1 836m4jX0bvMEEz5O+mPlZL/RJMz/q4KulnAYkZ7sART3q/rRLzt4rkffdYUNTEj44ZDT 6eHg== 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=L3xl21gY8IjvoM14R9RdbyocUZiHC82Imtl2NhUAX0I=; b=weMjaaO1X/V9OnoMN5DlzA1GcVxbvuzOu55LQqlnDPd4VDV/atK6AeoPNEiimN46Ea lQa+rZ9i42MO2beUa1qpwuDZ047DUbQb+CIj91/Nv7jCc7Exv9yWcJKXexyGvbqgplRc q1uDr/bHxUUtBAi81qaqaNTjUmKocy0PKW8bgNLyv4a+IjgZy4HxoPwm3qdiSMc2HMuj OpyWfij6w9RLwKOhrJ6x2RDt7dOx98/JBgJ60vesCxG2GjvXCypyhFYapSaWt2ZPS76s QEzRpbpc8hUEJ2GokzWJUFyJHAUo0ESdH3vuNYq4PVRXgtCGtLcBY5SF39+t9CZj/sXp kiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pxsu8kXO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n4-20020a170903404400b00161f1941a63si22493881pla.357.2022.06.07.20.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:58:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pxsu8kXO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 109E8185C98; Tue, 7 Jun 2022 20:22:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378855AbiFGWiW (ORCPT + 99 others); Tue, 7 Jun 2022 18:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378904AbiFGVZK (ORCPT ); Tue, 7 Jun 2022 17:25:10 -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 C97EE150B41; Tue, 7 Jun 2022 12:01:21 -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 2DA06B8233E; Tue, 7 Jun 2022 19:01:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87DFEC385A2; Tue, 7 Jun 2022 19:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628478; bh=T04zD/kamlsl9uHu7aMlFk9q50TBCHaqcmwGGQPsEOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pxsu8kXOADV+YdSZm7seqjAODjjobBcrUUoqdpRkBjRku5ARf1URvv5GnkZgTOkJ6 j03Gk/DTpehAj93TspIjChqMJWf4IWY1b6bT1XYhFzGVzmCT4BQAbLSISHQGZSsDZj OTNoDL0H3a8cnEgRvc4b68vVsqpq1dMusebWCA20= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Robert Foss , Sasha Levin Subject: [PATCH 5.18 327/879] drm/bridge: Fix error handling in analogix_dp_probe Date: Tue, 7 Jun 2022 18:57:25 +0200 Message-Id: <20220607165012.344783637@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Miaoqian Lin [ Upstream commit 9f15930bb2ef9f031d62ffc49629cbae89137733 ] In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call, as already done in the remove function. Fixes: 3424e3a4f844 ("drm: bridge: analogix/dp: split exynos dp driver to bridge directory") Signed-off-by: Miaoqian Lin Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220420011644.25730-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- .../gpu/drm/bridge/analogix/analogix_dp_core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index eb590fb8e8d0..474ef88015ae 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1698,8 +1698,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dp->reg_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(dp->reg_base)) - return ERR_CAST(dp->reg_base); + if (IS_ERR(dp->reg_base)) { + ret = PTR_ERR(dp->reg_base); + goto err_disable_clk; + } dp->force_hpd = of_property_read_bool(dev->of_node, "force-hpd"); @@ -1711,7 +1713,8 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) if (IS_ERR(dp->hpd_gpiod)) { dev_err(dev, "error getting HDP GPIO: %ld\n", PTR_ERR(dp->hpd_gpiod)); - return ERR_CAST(dp->hpd_gpiod); + ret = PTR_ERR(dp->hpd_gpiod); + goto err_disable_clk; } if (dp->hpd_gpiod) { @@ -1731,7 +1734,8 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) if (dp->irq == -ENXIO) { dev_err(&pdev->dev, "failed to get irq\n"); - return ERR_PTR(-ENODEV); + ret = -ENODEV; + goto err_disable_clk; } ret = devm_request_threaded_irq(&pdev->dev, dp->irq, @@ -1740,11 +1744,15 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) irq_flags, "analogix-dp", dp); if (ret) { dev_err(&pdev->dev, "failed to request irq\n"); - return ERR_PTR(ret); + goto err_disable_clk; } disable_irq(dp->irq); return dp; + +err_disable_clk: + clk_disable_unprepare(dp->clock); + return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(analogix_dp_probe); -- 2.35.1