[Mesa-dev] [PATCH] radeonsi: Fix resource leak in gs_copy_shader allocation failure path

Mun, Gwan-gyeong elongbug at gmail.com
Mon Nov 21 12:57:19 UTC 2016


Hi, Edward O'Callaghan , Marek Olšák and Nicolai Hähnle

Thanks for reviewing. As I do not have the permission of mesa git, I
can not push it.

If you have permission for git push, can you push this patch?

Best regards,

Gwan-gyeong.

2016-11-21 17:41 GMT+09:00 Nicolai Hähnle <nhaehnle at gmail.com>:
> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
>
> On 20.11.2016 05:19, Mun Gwan-gyeong wrote:
>>
>> CID 1394028
>>
>> Signed-off-by: Mun Gwan-gyeong <elongbug at gmail.com>
>> ---
>>  src/gallium/drivers/radeonsi/si_shader.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeonsi/si_shader.c
>> b/src/gallium/drivers/radeonsi/si_shader.c
>> index 917e148..608cb72 100644
>> --- a/src/gallium/drivers/radeonsi/si_shader.c
>> +++ b/src/gallium/drivers/radeonsi/si_shader.c
>> @@ -6137,9 +6137,15 @@ si_generate_gs_copy_shader(struct si_screen
>> *sscreen,
>>
>>         outputs = MALLOC(gsinfo->num_outputs * sizeof(outputs[0]));
>>
>> +       if (!outputs)
>> +               return NULL;
>> +
>>         shader = CALLOC_STRUCT(si_shader);
>> -       if (!shader)
>> +       if (!shader) {
>> +               FREE(outputs);
>>                 return NULL;
>> +       }
>> +
>>
>>         shader->selector = gs_selector;
>>         shader->is_gs_copy_shader = true;
>>
>



-- 
Mun, Gwan-gyeong


More information about the mesa-dev mailing list