]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/tve200: Fix probe cleanup after register failure
authorMyeonghun Pak <mhun512@gmail.com>
Fri, 24 Apr 2026 12:40:39 +0000 (21:40 +0900)
committerLinus Walleij <linusw@kernel.org>
Tue, 5 May 2026 09:16:39 +0000 (11:16 +0200)
tve200_modeset_init() creates a panel bridge and initializes the DRM
mode config before tve200_probe() registers the DRM device. If
drm_dev_register() fails, probe returns an error and the driver's remove
callback is not called, so those modeset resources are left behind.

Unwind the panel bridge and mode config on that failure path before
disabling the clock and dropping the DRM device reference.

Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260424124118.38649-1-mhun512@gmail.com
drivers/gpu/drm/tve200/tve200_drv.c

index a048e37f1c2c1175427ac14224b18f9946ad524c..562f3f11812a39f5a653be320282914312b06c94 100644 (file)
@@ -221,12 +221,16 @@ static int tve200_probe(struct platform_device *pdev)
 
        ret = drm_dev_register(drm, 0);
        if (ret < 0)
-               goto clk_disable;
+               goto mode_config_cleanup;
 
        drm_client_setup_with_fourcc(drm, DRM_FORMAT_RGB565);
 
        return 0;
 
+mode_config_cleanup:
+       if (priv->panel)
+               drm_panel_bridge_remove(priv->bridge);
+       drm_mode_config_cleanup(drm);
 clk_disable:
        clk_disable_unprepare(priv->pclk);
 dev_unref: