lima: Ensure jobs initialized before calling lima_job_fini()
To avoid crash during cleanup if lima_context_create fails. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7196 Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18407>
This commit is contained in:
committed by
Marge Bot
parent
027b8b4249
commit
b8c026a365
@@ -139,7 +139,8 @@ lima_context_destroy(struct pipe_context *pctx)
|
||||
struct lima_context *ctx = lima_context(pctx);
|
||||
struct lima_screen *screen = lima_screen(pctx->screen);
|
||||
|
||||
lima_job_fini(ctx);
|
||||
if (ctx->jobs)
|
||||
lima_job_fini(ctx);
|
||||
|
||||
for (int i = 0; i < lima_ctx_buff_num; i++)
|
||||
pipe_resource_reference(&ctx->buffer_state[i].res, NULL);
|
||||
|
||||
Reference in New Issue
Block a user