summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-02-19 00:06:52 +0100
committerMarek Olšák <maraeo@gmail.com>2011-02-19 00:06:52 +0100
commite9e5380f22c230ea1276208baa40c3fe6482b296 (patch)
tree1ebc5f9cf0ffdb2ccd22b07be436f0d7c69e53f1
parente16e70610c459721f4344dc6e61a8af1c2ad870d (diff)
r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index 8f6f4a1f35..a38b01048b 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -110,8 +110,8 @@ static void radeon_cs_context_cleanup(struct radeon_cs_context *csc)
unsigned i;
for (i = 0; i < csc->crelocs; i++) {
- radeon_bo_unref(csc->relocs_bo[i]);
p_atomic_dec(&csc->relocs_bo[i]->num_cs_references);
+ radeon_bo_unref(csc->relocs_bo[i]);
csc->relocs_bo[i] = NULL;
}