[Mesa-dev] [PATCH v2] radeonsi: Add missing error-checking to si_create_compute_state (v2)
Marek Olšák
maraeo at gmail.com
Mon Nov 21 20:40:12 UTC 2016
Pushed, thanks.
Marek
On Mon, Nov 21, 2016 at 3:24 PM, Edward O'Callaghan
<funfunctor at folklore1984.net> wrote:
> Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
>
> On 11/22/2016 01:20 AM, Mun Gwan-gyeong wrote:
>> When the uploading of shader fails on si_shader_binary_upload(),
>> it returns -ENOMEM. We should handle si_shader_binary_upload() failure path
>> on si_create_compute_state().
>>
>> CID 1394027
>>
>> v2: Fixes from Edward O'Callaghan's review
>> a) Update explicitly return value check with "si_shader_binary_upload() < 0"
>> b) Update commit message.
>>
>> Signed-off-by: Mun Gwan-gyeong <elongbug at gmail.com>
>> ---
>> src/gallium/drivers/radeonsi/si_compute.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
>> index f1887bb..0815713 100644
>> --- a/src/gallium/drivers/radeonsi/si_compute.c
>> +++ b/src/gallium/drivers/radeonsi/si_compute.c
>> @@ -165,7 +165,11 @@ static void *si_create_compute_state(
>> }
>> si_shader_dump(sctx->screen, &program->shader, &sctx->b.debug,
>> PIPE_SHADER_COMPUTE, stderr);
>> - si_shader_binary_upload(sctx->screen, &program->shader);
>> + if (si_shader_binary_upload(sctx->screen, &program->shader) < 0) {
>> + fprintf(stderr, "LLVM failed to upload shader\n");
>> + FREE(program);
>> + return NULL;
>> + }
>> }
>>
>> return program;
>>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list