Mesa (master): nouveau: fix nouveau_scratch_runout_release bo count underflow

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Sun May 6 20:04:16 UTC 2012


Module: Mesa
Branch: master
Commit: 9dfac63ae0a8759e05dbde20c2cea05afc121def
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dfac63ae0a8759e05dbde20c2cea05afc121def

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sat May  5 13:28:19 2012 +0200

nouveau: fix nouveau_scratch_runout_release bo count underflow

---

 src/gallium/drivers/nouveau/nouveau_buffer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c
index 369492d..f662990 100644
--- a/src/gallium/drivers/nouveau/nouveau_buffer.c
+++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
@@ -524,8 +524,10 @@ nouveau_scratch_runout_release(struct nouveau_context *nv)
 {
    if (!nv->scratch.nr_runout)
       return;
-   while (nv->scratch.nr_runout--)
+   do {
+      --nv->scratch.nr_runout;
       nouveau_bo_ref(NULL, &nv->scratch.runout[nv->scratch.nr_runout]);
+   } while (nv->scratch.nr_runout);
 
    FREE(nv->scratch.runout);
    nv->scratch.end = 0;




More information about the mesa-commit mailing list