[PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails

From: Osama Abdelkader

Date: Fri Apr 10 2026 - 17:29:52 EST


when component_add fails in sti_hda_probe remove drm
bridge before return

Signed-off-by: Osama Abdelkader <osama.abdelkader@xxxxxxxxx>
---
drivers/gpu/drm/sti/sti_hda.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index b7397827889c..1b4ba9097005 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -741,6 +741,7 @@ static int sti_hda_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct sti_hda *hda;
struct resource *res;
+ int ret;

DRM_INFO("%s\n", __func__);

@@ -783,7 +784,10 @@ static int sti_hda_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, hda);

- return component_add(&pdev->dev, &sti_hda_ops);
+ ret = component_add(&pdev->dev, &sti_hda_ops);
+ if (ret)
+ drm_bridge_remove(&hda->bridge);
+ return ret;
}

static void sti_hda_remove(struct platform_device *pdev)
--
2.43.0