From cd313a8d5d1363929bebac83f81e347b4a9e70f1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 2 Mar 2013 22:52:15 +0000 Subject: [PATCH] sna/dri: Guard against failed batch submission Avoid dereferencing a NULL bo if we do not submit a batch for the copy operation. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61708 Signed-off-by: Chris Wilson --- src/sna/sna_dri.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index d30c3a4b..e3bca1b1 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -725,7 +725,8 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region, if (flush) { /* STAT! */ struct kgem_request *rq = sna->kgem.next_request; kgem_submit(&sna->kgem); - bo = kgem_bo_reference(rq->bo); + if (rq->bo) + bo = kgem_bo_reference(rq->bo); } }