[Mesa-dev] [PATCH 2/8] nvc0: avoid null deref of screen when collecting stats

Ilia Mirkin imirkin at alum.mit.edu
Sat Sep 6 09:36:14 PDT 2014


Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
index 50c2058..b33a673 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
@@ -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
-- 
1.8.5.5



More information about the mesa-dev mailing list