From 614944b8975ce9827b26b92f42ad8b48493eb7f0 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 25 Feb 2013 23:31:10 -0800 Subject: [PATCH] i965: Turn if (query->bo) into an assertion. The code a few lines above calls brw_emit_query_begin() if !query->bo, and that creates query->bo. So it should always be non-NULL. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_queryobj.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index 0881ab93893..0cdfa6e486b 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -404,12 +404,12 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q) brw_emit_query_begin(brw); } - if (query->bo) { - brw_emit_query_end(brw); + assert(query->bo); - drm_intel_bo_unreference(brw->query.bo); - brw->query.bo = NULL; - } + brw_emit_query_end(brw); + + drm_intel_bo_unreference(brw->query.bo); + brw->query.bo = NULL; brw->query.obj = NULL; -- 2.30.2