diff options
author | Mun Gwan-gyeong <[email protected]> | 2016-11-21 23:20:43 +0900 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-11-21 21:09:06 +0100 |
commit | 44a3f2ee0974003597b0574f99c2440361d61b35 (patch) | |
tree | b5d1d4a7df99ed04ff147e8d2a1962871fde8c64 /src | |
parent | e442db8e9821d210df0a2f253d7b47bfad23a3bf (diff) |
radeonsi: Add missing error-checking to si_create_compute_state (v2)
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 <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_compute.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 69d57b9a616..e53ffa4cc72 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -170,7 +170,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; |