Mesa (master): radeonsi: handle dummy constant buffer allocation failure

Marek Olšák mareko at kemper.freedesktop.org
Thu Sep 24 17:51:49 UTC 2015


Module: Mesa
Branch: master
Commit: ae418a7b5640aadb625bb7a7d6e4aa0a98ccb77f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae418a7b5640aadb625bb7a7d6e4aa0a98ccb77f

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Sep 10 19:25:14 2015 +0200

radeonsi: handle dummy constant buffer allocation failure

Cc: 11.0 <mesa-stable at lists.freedesktop.org>
Acked-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/gallium/drivers/radeonsi/si_pipe.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 01fa525..9edee50 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -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++) {




More information about the mesa-commit mailing list