From: Marek Olšák Date: Fri, 11 Feb 2011 02:17:04 +0000 (+0100) Subject: r300g: prevent NULL pointer dereference in r300_buffer_create X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a1fe76a20c6eca67a8b933aa9e84f7ef0ad9ca2;p=mesa.git r300g: prevent NULL pointer dereference in r300_buffer_create Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=33185 --- 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; }