tests/gem_storedw_loop: Fix use after free for bufmgr

Move bufmgr destruction to end of tests. This avoids use after free on
successive tests.

This could be squashed with the following patch to aid bisectability:

commit 0679702150157706a6def66b893b29c16345f4db
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Aug 5 16:06:31 2015 -0700

    tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2

Signed-off-by: Robert Beckett <robert.beckett@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Robert Beckett 2015-09-22 19:02:39 +01:00 committed by Daniel Vetter
parent a16704261f
commit fb66cd5c34

View File

@ -128,7 +128,6 @@ store_test(int ring, int count)
drm_intel_bo_unreference(target_buffer);
intel_batchbuffer_free(batch);
drm_intel_bufmgr_destroy(bufmgr);
}
struct ring {
@ -181,5 +180,6 @@ igt_main
}
}
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
}