From patchwork Tue Dec 13 06:15:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 32650 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2661226wrr; Mon, 12 Dec 2022 22:22:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tygQ794vCUey7bZxwYdtLKPkyJqdaMgvK40BwEb1mhZTjMMuc/J8txCA4QrD20PUdO1mI X-Received: by 2002:a17:903:230d:b0:189:69d6:730c with SMTP id d13-20020a170903230d00b0018969d6730cmr26233167plh.32.1670912570874; Mon, 12 Dec 2022 22:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670912570; cv=none; d=google.com; s=arc-20160816; b=QLNICXjS67Ogd24moMH+iOOrhRAHpq9Agb2W60D9iILHdNh7s8q58A5KIdhnD+XtCd +uMVA01kF2Q4ecXHIpqp4KjTZAWl7htm3+07IBv2uVmgQcDHP3AbDkrDjD21CwHJisVS 0E/8DOa/KNFi1nFTbrEu8tFf5CTpeS5Am0Bp9L7GV24s2tCSVRDaaeAhQcigiQneo/9O 8Ovkzry+ZowVPdukmNB6c5QAMIkDXLNVFAcedGK6SwqZQR8qmqiLDZuV1GJaj4yzwl8j pRkcSJCUa7FEo/Gr+EMCSCwAq2U1iOgbRoFwyQOgPLsghTP6Z0HMzgkMsjPLYCZSINsF UBLg== 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 :message-id:date:subject:cc:to:from; bh=pZqjAWwLAiel/PLPcFydol6FKbtcx4XXRMJsGv30Z6Q=; b=ZQo+uYRF0RRq+dzvv9J0g5EzQVOF5bHkbg7Yfq3QXaCwfrEHbihZFc0j0oTAicEbtc MzPpavWC7YQsLfwK3tPvaCHBEjcQ5j+DP/j6Ohxs9qBeRK7rRDx5r8jefsqQs20o0Nd2 JK4F6mYrEg6933bh6WLNLHCHVOuceOcajiFRecXk7ebOqT2xnjNL+yguogt9DGzOfM83 klYi9n6x5GEZSmEsVJ5bHmCzpgawIn987Ma70rAdDsc6ZbsXnI0nu5loKts9dA+cnb0M D0ca+NA7gjNDkf0JIo4PsRTFzmlPzAbHBDJaB7EasAifpmCkP6MD3BnII4f5+xi70lcG Mgtg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u20-20020a170903309400b001892c399db0si10341541plc.363.2022.12.12.22.22.37; Mon, 12 Dec 2022 22:22:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234486AbiLMGPz (ORCPT + 99 others); Tue, 13 Dec 2022 01:15:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234477AbiLMGPw (ORCPT ); Tue, 13 Dec 2022 01:15:52 -0500 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A11515A00 for ; Mon, 12 Dec 2022 22:15:51 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 4yZvpMESVbw2u4yZvpN1WL; Tue, 13 Dec 2022 07:15:49 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 13 Dec 2022 07:15:49 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2] drm/msm/hdmi: Fix the error handling path of msm_hdmi_dev_probe() Date: Tue, 13 Dec 2022 07:15:33 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752078819460369311?= X-GMAIL-MSGID: =?utf-8?q?1752078819460369311?= If an error occurs after a successful msm_hdmi_get_phy() call, it must be undone by a corresponding msm_hdmi_put_phy(), as already done in the remove function. Fixes: 437365464043 ("drm/msm/hdmi: move msm_hdmi_get_phy() to msm_hdmi_dev_probe()") Signed-off-by: Christophe JAILLET Reviewed-by: Abhinav Kumar --- Change in v2: - Fix a typo in the prefix of the subject line [Abhinav Kumar] - Add R-b tag [Abhinav Kumar] v1: https://lore.kernel.org/all/b3d9dac978f1e2e42a40ec61f58aa98c44c85dfd.1670741386.git.christophe.jaillet@wanadoo.fr/ --- drivers/gpu/drm/msm/hdmi/hdmi.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 4d3fdc806bef..97372bb241d8 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -532,11 +532,19 @@ static int msm_hdmi_dev_probe(struct platform_device *pdev) ret = devm_pm_runtime_enable(&pdev->dev); if (ret) - return ret; + goto err_put_phy; platform_set_drvdata(pdev, hdmi); - return component_add(&pdev->dev, &msm_hdmi_ops); + ret = component_add(&pdev->dev, &msm_hdmi_ops); + if (ret) + goto err_put_phy; + + return 0; + +err_put_phy: + msm_hdmi_put_phy(hdmi); + return ret; } static int msm_hdmi_dev_remove(struct platform_device *pdev)