]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ti: vpe: unwind v4l2 device registration on probe error
authorMyeonghun Pak <mhun512@gmail.com>
Sun, 26 Apr 2026 13:16:31 +0000 (22:16 +0900)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 5 May 2026 14:57:03 +0000 (16:57 +0200)
If the vpe_top resource is missing, vpe_probe() returns -ENODEV after
v4l2_device_register() has succeeded. Probe failures do not call the
driver's remove callback, so the v4l2 device remains registered on that
error path.

Route that failure through the existing v4l2_device_unregister() unwind
label, matching the other errors after v4l2_device_register().

Fixes: 4d59c7d45585 ("media: ti-vpe: vpe: Add missing null pointer checks")
Cc: stable@vger.kernel.org
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/ti/vpe/vpe.c

index a7e5a85e72a149ab9795ff8e6eecfb0aa15cb549..81bd1f9cee302c31e34cd3573ab8d0e8a65c995f 100644 (file)
@@ -2539,7 +2539,8 @@ static int vpe_probe(struct platform_device *pdev)
                                                "vpe_top");
        if (!dev->res) {
                dev_err(&pdev->dev, "missing 'vpe_top' resources data\n");
-               return -ENODEV;
+               ret = -ENODEV;
+               goto v4l2_dev_unreg;
        }
 
        /*