drm/amdgpu: fix parser init error path to avoid crash in parser fini
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix parser init error path to avoid crash in parser fini
From: Dave Airlie <[email protected]>
If we don't reset the chunk info in the error path, the subsequent fini path will double free.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -0
@@ -240,6 +240,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)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:
Signature · 6 lines
2.9.3 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170310021304.13391-1-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Christian König
Reviewed-byAm 10.03.2017 um 03:13 schrieb Dave Airlie:
Quoted 6 lines
From: Dave Airlie <[email protected]>
If we don't reset the chunk info in the error path, the subsequent fini path will double free.
Signed-off-by Dave Airlie <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · line 247
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-0@@ -240,6 +240,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)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:
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 9da556f3-9390-0917-fa68-3b6bf7d967dd-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Alex Deucher
AppliedQuoted 11 lines · Christian König
Am 10.03.2017 um 03:13 schrieb Dave Airlie:
Quoted 7 lines
From: Dave Airlie <[email protected]>
If we don't reset the chunk info in the error path, the subsequent fini path will double free.
Signed-off-by Dave Airlie <[email protected]>Reviewed-by Christian König <[email protected]>
Applied. thanks!
Alex
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-0@@ -240,6 +240,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)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);
Quoted 8 lines
Quoted 1 line
free_chunk:_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx