Mesa (master): r300g: return NULL texture early if buffer_create fails

Marek Olšák mareko at kemper.freedesktop.org
Wed Jun 9 11:17:46 PDT 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Jun  9 20:16:00 2010 +0200

r300g: return NULL texture early if buffer_create fails

---

 src/gallium/drivers/r300/r300_texture.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 5a013e2..c95a3f7 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -979,16 +979,16 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
     tex->buffer = rws->buffer_create(rws, 2048, base->bind, tex->domain,
                                      tex->size);
 
+    if (!tex->buffer) {
+	FREE(tex);
+	return NULL;
+    }
+
     rws->buffer_set_tiling(rws, tex->buffer,
             tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
             tex->microtile,
             tex->macrotile);
 
-    if (!tex->buffer) {
-        FREE(tex);
-        return NULL;
-    }
-
     return (struct pipe_resource*)tex;
 }
 



More information about the mesa-commit mailing list