Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/sti: remove bridge when sti_hda component_add fails

Use devm_drm_bridge_add() so the bridge is released if probe fails after
registration, and drop the manual drm_bridge_remove() in remove().

Check the return value of devm_drm_bridge_add().

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Fixes: d28726efc637 ("drm/sti: hda: add bridge before attaching")
Cc: stable@vger.kernel.org
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Raphaël Gallais-Pou <rgallaispou@gmail.com>
Link: https://patch.msgid.link/20260423200622.325076-1-osama.abdelkader@gmail.com
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>

authored by

Osama Abdelkader and committed by
Raphael Gallais-Pou
84ae1840 b5d0ad61

+4 -4
+4 -4
drivers/gpu/drm/sti/sti_hda.c
··· 741 741 struct device *dev = &pdev->dev; 742 742 struct sti_hda *hda; 743 743 struct resource *res; 744 + int ret; 744 745 745 746 DRM_INFO("%s\n", __func__); 746 747 ··· 780 779 return PTR_ERR(hda->clk_hddac); 781 780 } 782 781 783 - drm_bridge_add(&hda->bridge); 782 + ret = devm_drm_bridge_add(dev, &hda->bridge); 783 + if (ret) 784 + return ret; 784 785 785 786 platform_set_drvdata(pdev, hda); 786 787 ··· 791 788 792 789 static void sti_hda_remove(struct platform_device *pdev) 793 790 { 794 - struct sti_hda *hda = platform_get_drvdata(pdev); 795 - 796 791 component_del(&pdev->dev, &sti_hda_ops); 797 - drm_bridge_remove(&hda->bridge); 798 792 } 799 793 800 794 static const struct of_device_id hda_of_match[] = {