summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-11-13 19:21:37 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-11-13 19:21:37 +0000
commit0340718366d7cb168a46930eb7be22f2d88354d8 (patch)
tree8c85f99c755eb73044d653a0e98a4e9ff3e734e8 /src/sna/sna_dri2.c
parent2d26643cab33a32847afaf13b50d326d09d58bf7 (diff)
sna/dri2: Don't try and destroy the NULL pointer
From the previous commit, we have to check for NULL before the dereference. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r--src/sna/sna_dri2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index f4fa081b..c0930249 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2527,8 +2527,10 @@ static bool sna_dri2_blit_complete(struct sna_dri2_event *info)
}
DBG(("%s: blit finished\n", __FUNCTION__));
- kgem_bo_destroy(&info->sna->kgem, info->bo);
- info->bo = NULL;
+ if (info->bo) {
+ kgem_bo_destroy(&info->sna->kgem, info->bo);
+ info->bo = NULL;
+ }
return true;
}