Skip to content

Commit f9c3452

Browse files
osamakadergregkh
authored andcommitted
drm/exynos: remove bridge when component_add fails
commit 26f6654 upstream. 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: 576d72f ("drm/exynos: mic: add a bridge at probe") Cc: stable@vger.kernel.org Reviewed-by: Raphaël Gallais-Pou <rgallaispou@gmail.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://patch.msgid.link/20260423200622.325076-2-osama.abdelkader@gmail.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8ae8b9e commit f9c3452

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/gpu/drm/exynos/exynos_drm_mic.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,9 @@ static int exynos_mic_probe(struct platform_device *pdev)
424424
mic->bridge.funcs = &mic_bridge_funcs;
425425
mic->bridge.of_node = dev->of_node;
426426

427-
drm_bridge_add(&mic->bridge);
427+
ret = devm_drm_bridge_add(dev, &mic->bridge);
428+
if (ret)
429+
goto err;
428430

429431
pm_runtime_enable(dev);
430432

@@ -444,12 +446,8 @@ static int exynos_mic_probe(struct platform_device *pdev)
444446

445447
static void exynos_mic_remove(struct platform_device *pdev)
446448
{
447-
struct exynos_mic *mic = platform_get_drvdata(pdev);
448-
449449
component_del(&pdev->dev, &exynos_mic_component_ops);
450450
pm_runtime_disable(&pdev->dev);
451-
452-
drm_bridge_remove(&mic->bridge);
453451
}
454452

455453
static const struct of_device_id exynos_mic_of_match[] = {

0 commit comments

Comments
 (0)