[PATCH i-g-t 3/5] lib: NULLify ->cairo_surface once unmapped

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just a matter of not leaving dangling pointers around.

Signed-off-by: Damien Lespiau <damien.lespiau@xxxxxxxxx>
---
 lib/igt_fb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 39a1f62..83f4343 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -521,7 +521,9 @@ static cairo_format_t drm_format_to_cairo(uint32_t drm_format)
 static void destroy_cairo_surface__gtt(void *arg)
 {
 	struct igt_fb *fb = arg;
+
 	munmap(cairo_image_surface_get_data(fb->cairo_surface), fb->size);
+	fb->cairo_surface = NULL;
 }
 
 static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
-- 
1.8.3.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux