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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-03-02 22:52:15 +00:00
parent e4df4e03b1
commit cd313a8d5d
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}
}