From 9a1fe76a20c6eca67a8b933aa9e84f7ef0ad9ca2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 11 Feb 2011 03:17:04 +0100 Subject: [PATCH] r300g: prevent NULL pointer dereference in r300_buffer_create Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=33185 --- src/gallium/drivers/r300/r300_screen_buffer.c | 6 +++--- 1 file 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; } -- 2.30.2