Browse Source

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: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie 8 years ago
parent
commit
607523d19c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

+ 2 - 0
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

@@ -240,6 +240,8 @@ free_partial_kdata:
 	for (; i >= 0; i--)
 		drm_free_large(p->chunks[i].kdata);
 	kfree(p->chunks);
+	p->chunks = NULL;
+	p->nchunks = 0;
 put_ctx:
 	amdgpu_ctx_put(p->ctx);
 free_chunk: