From nobody Thu Sep 18 01:17:58 2025 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 623BFC4332F for ; Tue, 13 Dec 2022 06:15:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234010AbiLMGP4 (ORCPT ); Tue, 13 Dec 2022 01:15:56 -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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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.167074= 1386.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/hdm= i.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) =20 ret =3D devm_pm_runtime_enable(&pdev->dev); if (ret) - return ret; + goto err_put_phy; =20 platform_set_drvdata(pdev, hdmi); =20 - return component_add(&pdev->dev, &msm_hdmi_ops); + ret =3D 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; } =20 static int msm_hdmi_dev_remove(struct platform_device *pdev) --=20 2.34.1