[Intel-gfx] [PATCH i-g-t 3/5] lib: NULLify ->cairo_surface once unmapped
Damien Lespiau
damien.lespiau at intel.com
Fri Jul 11 16:09:03 CEST 2014
Just a matter of not leaving dangling pointers around.
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
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
More information about the Intel-gfx
mailing list