[Intel-gfx] [PATCH xf86-video-intel] sna: Fix double-free crashes

Alexei Podtelezhnikov apodtele at gmail.com
Wed Apr 8 02:41:33 UTC 2020


Fix double-free crashes.
See https://bugzilla.redhat.com/show_bug.cgi?id=1808767

Signed-off-by:  Alexei Podtelezhnikov <apodtele at gmail.com>
---
 src/sna/kgem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6a35067c..9865a912 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3079,6 +3079,9 @@ static void kgem_buffer_release(struct kgem *kgem, struct kgem_buffer *bo)
 		assert(cached != &bo->base);
 		list_del(&cached->vma);
 
+               if (!cached->map__gtt)
+                       continue;
+
 		assert(*(struct kgem_bo **)cached->map__gtt == cached);
 		*(struct kgem_bo **)cached->map__gtt = NULL;
 		cached->map__gtt = NULL;
-- 
2.26.0



More information about the Intel-gfx mailing list