Commit 607523d1 authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher

drm/amdgpu: fix parser init error path to avoid crash in parser fini

If we don't reset the chunk info in the error path, the subsequent
fini path will double free.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d8a8ed97
...@@ -240,6 +240,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) ...@@ -240,6 +240,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
for (; i >= 0; i--) for (; i >= 0; i--)
drm_free_large(p->chunks[i].kdata); drm_free_large(p->chunks[i].kdata);
kfree(p->chunks); kfree(p->chunks);
p->chunks = NULL;
p->nchunks = 0;
put_ctx: put_ctx:
amdgpu_ctx_put(p->ctx); amdgpu_ctx_put(p->ctx);
free_chunk: free_chunk:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment