summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-02-11 03:17:04 +0100
committerMarek Olšák <[email protected]>2011-02-11 03:18:05 +0100
commit9a1fe76a20c6eca67a8b933aa9e84f7ef0ad9ca2 (patch)
treec92662b8ff40cd833bbc1adf6afcabadcee90959
parent2e8726f5b156ec59fd5c8b80a7947183055d80c2 (diff)
r300g: prevent NULL pointer dereference in r300_buffer_create
Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=33185
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 2e85e2d6ffb..04afae609f9 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -226,14 +226,14 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
rbuf->b.b.b.width0, alignment,
rbuf->b.b.b.bind, rbuf->b.b.b.usage,
rbuf->domain);
- rbuf->cs_buf =
- r300screen->rws->buffer_get_cs_handle(rbuf->buf);
-
if (!rbuf->buf) {
util_slab_free(&r300screen->pool_buffers, rbuf);
return NULL;
}
+ rbuf->cs_buf =
+ r300screen->rws->buffer_get_cs_handle(rbuf->buf);
+
return &rbuf->b.b.b;
}