From: Brian Paul Date: Fri, 21 Jun 2013 22:09:05 +0000 (-0600) Subject: svga: add null ptr check in svga_get_tex_sampler_view() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b03f3945080971004f2ba0952ea13d7be4bf3c43;p=mesa.git svga: add null ptr check in svga_get_tex_sampler_view() Trivial. --- diff --git a/src/gallium/drivers/svga/svga_sampler_view.c b/src/gallium/drivers/svga/svga_sampler_view.c index efbc13899a4..1950784a15a 100644 --- a/src/gallium/drivers/svga/svga_sampler_view.c +++ b/src/gallium/drivers/svga/svga_sampler_view.c @@ -103,6 +103,9 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, } sv = CALLOC_STRUCT(svga_sampler_view); + if (!sv) + return NULL; + pipe_reference_init(&sv->reference, 1); /* Note: we're not refcounting the texture resource here to avoid