From: Francisco Jerez Date: Fri, 29 Oct 2010 19:14:49 +0000 (+0200) Subject: dri/nouveau: Avoid recursion in nouveau_bo_context_reset(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dbe1eae785e8a98eb3d515b572c8e5e28b234edd;p=mesa.git dri/nouveau: Avoid recursion in nouveau_bo_context_reset(). --- diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c index f31772fe1d1..7eef8c1ee81 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c @@ -126,13 +126,13 @@ void nouveau_bo_context_reset(struct nouveau_bo_context *bctx) { struct nouveau_bo_state *s = &to_nouveau_context(bctx->ctx)->bo; - int i; - - for (i = 0; i < bctx->count; i++) - nouveau_bo_ref(NULL, &bctx->marker[i].bo); + int i, n = bctx->count; - s->count -= bctx->count; + s->count -= n; bctx->count = 0; + + for (i = 0; i < n; i++) + nouveau_bo_ref(NULL, &bctx->marker[i].bo); } GLboolean