OSDN Git Service

r600g: Don't leave stale references in query_list when we cannot create bo.
authorTilman Sauerbeck <tilman@code-monkey.de>
Thu, 9 Sep 2010 11:51:51 +0000 (13:51 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Fri, 10 Sep 2010 11:09:33 +0000 (13:09 +0200)
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
src/gallium/drivers/r600/r600_query.c

index 530940e..0073072 100644 (file)
@@ -77,7 +77,6 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q
                return NULL;
 
        q->type = query_type;
-       LIST_ADDTAIL(&q->list, &rctx->query_list);
        q->buffer_size = 4096;
 
        q->buffer = radeon_bo(rscreen->rw, 0, q->buffer_size, 1, NULL);
@@ -85,6 +84,9 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q
                FREE(q);
                return NULL;
        }
+
+       LIST_ADDTAIL(&q->list, &rctx->query_list);
+
        return (struct pipe_query *)q;
 }