nvc0: avoid null deref of screen when collecting stats
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 6 Sep 2014 15:05:20 +0000 (11:05 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 9 Sep 2014 00:06:11 +0000 (20:06 -0400)
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_context.c

index 50c2058efca7d8d93a471f544d47315921be1b58..b33a6731a1c0ee43b73dabf85cb9efde637c9d65 100644 (file)
@@ -163,8 +163,8 @@ nvc0_default_kick_notify(struct nouveau_pushbuf *push)
       nouveau_fence_update(&screen->base, TRUE);
       if (screen->cur_ctx)
          screen->cur_ctx->state.flushed = TRUE;
+      NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1);
    }
-   NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1);
 }
 
 static int