[igt-dev] [PATCH 1/2] tests/fbdev: Store framebuffer pointer at function scope
Thomas Zimmermann
tzimmermann at suse.de
Tue Nov 3 10:48:12 UTC 2020
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
---
tests/fbdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/fbdev.c b/tests/fbdev.c
index e5efeb93..11df954d 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -42,6 +42,7 @@ igt_main
struct fb_var_screeninfo var_info;
struct fb_fix_screeninfo fix_info;
int fd = -1;
+ void *map = NULL;
/*
* Should this test focus on the fbdev independent of any drm driver,
@@ -71,7 +72,6 @@ igt_main
}
igt_subtest("mmap") {
- void *map;
igt_require(fix_info.smem_len);
@@ -80,10 +80,11 @@ igt_main
igt_assert(map != MAP_FAILED);
memset(map, 0, fix_info.smem_len);
- munmap(map, fix_info.smem_len);
}
igt_fixture {
+ if (map && map != MAP_FAILED)
+ munmap(map, fix_info.smem_len);
close(fd);
}
}
--
2.29.0
More information about the igt-dev
mailing list