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

Christian König deathsimple at vodafone.de
Fri Mar 10 09:16:18 UTC 2017


Am 10.03.2017 um 03:13 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
>
> If we don't reset the chunk info in the error path, the subsequent
> fini path will double free.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index d2d0f60..99424cb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -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:




More information about the amd-gfx mailing list