panvk: Free the decode context in the create_device() error path

If we don't do that and something fails in the middle, we leak
the decode context.

Fixes: d155d6b7a3 ("panvk: Add a decode context at the panvk_device level")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit 55481b6f10)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39003>
This commit is contained in:
Boris Brezillon 2025-12-13 14:53:10 +01:00 committed by Dylan Baker
parent 33f50d918f
commit 8f15e54119
2 changed files with 4 additions and 1 deletions

View file

@ -124,7 +124,7 @@
"description": "panvk: Free the decode context in the create_device() error path",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d155d6b7a334f07ad652e5a87f16f3302c7b968b",
"notes": null

View file

@ -596,6 +596,9 @@ err_free_priv_bos:
simple_mtx_destroy(&device->as.lock);
err_destroy_kdev:
if (device->debug.decode_ctx)
pandecode_destroy_context(device->debug.decode_ctx);
pan_kmod_dev_destroy(device->kmod.dev);
err_finish_dev: