summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nouveau_buffer.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2012-05-05 13:28:19 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2012-05-06 22:03:06 +0200
commit9dfac63ae0a8759e05dbde20c2cea05afc121def (patch)
tree678979686b5cfaab62ec94c4571305f94a50e266 /src/gallium/drivers/nouveau/nouveau_buffer.c
parent5795d3b5aec767dc2d7901b432f9182121b8e46f (diff)
nouveau: fix nouveau_scratch_runout_release bo count underflow
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_buffer.c')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_buffer.c4
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 369492de317..f6629901c15 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;