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

Alex Deucher alexdeucher at gmail.com
Fri Mar 10 19:29:23 UTC 2017


On Fri, Mar 10, 2017 at 4:16 AM, Christian König
<deathsimple at vodafone.de> wrote:
> 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>

Applied.  thanks!

Alex

>
>> ---
>>   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:
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list