radeonsi: handle dummy constant buffer allocation failure
authorMarek Olšák <marek.olsak@amd.com>
Thu, 10 Sep 2015 17:25:14 +0000 (19:25 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 24 Sep 2015 17:51:43 +0000 (19:51 +0200)
Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c

index 01fa5252f71cf94c5a99933c0d949a0e24d17a53..9edee50ac8a4e3668d1b5b3666a58cbfc1d30f6b 100644 (file)
@@ -180,6 +180,8 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
        if (sctx->b.chip_class == CIK) {
                sctx->null_const_buf.buffer = pipe_buffer_create(screen, PIPE_BIND_CONSTANT_BUFFER,
                                                                 PIPE_USAGE_DEFAULT, 16);
+               if (!sctx->null_const_buf.buffer)
+                       goto fail;
                sctx->null_const_buf.buffer_size = sctx->null_const_buf.buffer->width0;
 
                for (shader = 0; shader < SI_NUM_SHADERS; shader++) {