]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/media/platform/qcom/venus/core.c
media: venus: core: Fix a resource leak in the error handling path of 'venus_probe()'
[mirror_ubuntu-jammy-kernel.git] / drivers / media / platform / qcom / venus / core.c
index 84cd92628cfdcbd65c533c02d13f87f13842981f..1f0181b6353c9b4fb7f9d92bc836ec9a941126e5 100644 (file)
@@ -349,11 +349,11 @@ static int venus_probe(struct platform_device *pdev)
 
        ret = venus_firmware_init(core);
        if (ret)
-               goto err_runtime_disable;
+               goto err_of_depopulate;
 
        ret = venus_boot(core);
        if (ret)
-               goto err_runtime_disable;
+               goto err_firmware_deinit;
 
        ret = hfi_core_resume(core, true);
        if (ret)
@@ -385,6 +385,10 @@ err_dev_unregister:
        v4l2_device_unregister(&core->v4l2_dev);
 err_venus_shutdown:
        venus_shutdown(core);
+err_firmware_deinit:
+       venus_firmware_deinit(core);
+err_of_depopulate:
+       of_platform_depopulate(dev);
 err_runtime_disable:
        pm_runtime_put_noidle(dev);
        pm_runtime_set_suspended(dev);