nouveau: check for mesa context init failure
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 13 Sep 2014 15:28:28 +0000 (11:28 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 13 Sep 2014 15:29:23 +0000 (11:29 -0400)
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/drivers/dri/nouveau/nouveau_context.c

index f8c8dc3870166e7ff62b6363f1cbd629f09f4b75..5be5ec5bc24aab1d9a22723b6bdaaeadd74bfdfe 100644 (file)
@@ -126,8 +126,8 @@ nouveau_context_init(struct gl_context *ctx, gl_api api,
        nouveau_fbo_functions_init(&functions);
 
        /* Initialize the mesa context. */
-       _mesa_initialize_context(ctx, api, visual,
-                                 share_ctx, &functions);
+       if (!_mesa_initialize_context(ctx, api, visual, share_ctx, &functions))
+               return GL_FALSE;
 
        nouveau_state_init(ctx);
        nouveau_scratch_init(ctx);