summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-04 10:19:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-04 10:20:26 +0000
commit70c9e70f35af21de2b5b56d72f2a9e7fe9ed49d6 (patch)
treea74ebef23cd2e9a6d18c1b3f545f50d0300e7a30
parent7e8c9a5b8b1625fdfe885740c36da3f4c1373ee6 (diff)
sna: Don't reuse partial vmapped bo
A fun use after free. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index abf7e82a..e6df36f5 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -766,7 +766,7 @@ static void kgem_finish_partials(struct kgem *kgem)
}
/* transfer the handle to a minimum bo */
- if (bo->base.refcnt == 1) {
+ if (bo->base.refcnt == 1 && !bo->base.sync) {
struct kgem_bo *base = malloc(sizeof(*base));
if (base) {
memcpy(base, &bo->base, sizeof (*base));