Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2299857iof; Wed, 8 Jun 2022 01:51:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS19wFBz/nHypc9jrdHYpmrrtQ6pLJbJlFSO11NgBrLXniuEraISg+aipHqEMy9AqmUnvc X-Received: by 2002:a17:90b:1e06:b0:1e3:7d5:b542 with SMTP id pg6-20020a17090b1e0600b001e307d5b542mr52524530pjb.230.1654678298522; Wed, 08 Jun 2022 01:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654678298; cv=none; d=google.com; s=arc-20160816; b=O5CPlpSUQ4OKaVuVeMfc88BMG/mWAFA3av5xFdOPvbBTaAD7CCbgbkm+bJNMZ9Cs9g MYX/wSSk1gQhItE0zq+Kwm8/PTDrQKNmQYE8MpJuVO2k/pK9haihXnPDRvFkyb3K8PE1 xt8z+Wnalp6eTVcThCMTTqG3sq61L0nII5kooXCqHxhlK6bBe8vxvCebxiQ56N0wIMRQ CJSkkPTsJS5mSAxsxTGm49Au2pFMe6VAz1e0RFVgRSqdSLaFxUQdyf2dwOoLWvdgUdJw q4OBNrsYP5S3YiGYTJIogwCBYxkXPDT8T1nj69RuhbVdtFqq0qCjNjEun1e5SC3ApE3s 8uzQ== 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=VNRLWj0wfkS7O8mCPDgK2ZBWEId1ZANIaZXfuHW7nt0=; b=M5L3UfLQMAzGp9hOoiJK3q+NdsyO70Ksdu93/3lV4zdVB7Rj/vSNS9pqWOnKmam4we e++OeIYXkKTRGFbMIrlRKmKRGKQhqx9k7Y+38mprkx3snJeLq9Li1VIwVZ/XGIqEreCk DxbzjlJsUgsTrZ+nBSZbNwvNB08BBBBCGAIivVLZcwTssM7ClSIhUjq1JEbrApIprsNO NDAejzl7hsHRE4Vuy6TdivLNvh8QeQ81H87MrDYzT7SwwM55Q5xMit3ZxvfM1XXXidbg JBjS0u6wIhH6Yn+nTUvlMBTotADm2OorON7bckWFOG3yz5DSKFn1omlGOQ6fMksR+QjG xl8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LH4RE+uo; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id h24-20020a17090acf1800b001d26ee86442si24356010pju.93.2022.06.08.01.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:51:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LH4RE+uo; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 84275C5E58; Wed, 8 Jun 2022 01:14:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348711AbiFGRuB (ORCPT + 99 others); Tue, 7 Jun 2022 13:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346743AbiFGR3s (ORCPT ); Tue, 7 Jun 2022 13:29:48 -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 4E435119901; Tue, 7 Jun 2022 10:25:03 -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 C4DFEB81F38; Tue, 7 Jun 2022 17:25:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31BEEC385A5; Tue, 7 Jun 2022 17:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622700; bh=0944yUGQ3gyh8LgxQgruBWjnc/ggCPNvZO7sNZn8mHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LH4RE+uo5fNsGWZFhG2319gWfo90wWCD51vYQYhlQMVMU3JYEWTCdk7YZ4kOQI71+ dZSsX1U0WCMfg6kJBW+az/5p6x4UmdvJsUXJcLl6Y8GRfI4+SOzopKEf9NaJILkVCm ouNfibzQsNvDBgcGvE7haNK4vI4YTWIXilF9rqy4= 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.10 151/452] drm/bridge: Fix error handling in analogix_dp_probe Date: Tue, 7 Jun 2022 19:00:08 +0200 Message-Id: <20220607164913.057979759@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 aa1bb86293fd..31b4ff60a010 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1705,8 +1705,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"); @@ -1718,7 +1720,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) { @@ -1738,7 +1741,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, @@ -1747,11 +1751,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