public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] Fix use of results after being unmapped
@ 2019-06-14  8:26 Yann Sionneau
  2019-06-14  9:25 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Yann Sionneau @ 2019-06-14  8:26 UTC (permalink / raw)
  To: ltp

This fixes issue reported there: https://github.com/linux-test-project/ltp/issues/537

Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
---
 lib/tst_test.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 95f389d..7395996 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -138,6 +138,7 @@ static void cleanup_ipc(void)
 	if (results) {
 		msync((void*)results, size, MS_SYNC);
 		munmap((void*)results, size);
+		results = NULL;
 	}
 }
 
@@ -921,10 +922,10 @@ static void do_cleanup(void)
 	if (tst_test->save_restore)
 		tst_sys_conf_restore(0);
 
-	cleanup_ipc();
-
 	if (tst_test->restore_wallclock)
 		tst_wallclock_restore();
+
+	cleanup_ipc();
 }
 
 static void run_tests(void)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [PATCH v2] Fix use of results after being unmapped
  2019-06-14  8:26 [LTP] [PATCH v2] Fix use of results after being unmapped Yann Sionneau
@ 2019-06-14  9:25 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2019-06-14  9:25 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-14  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14  8:26 [LTP] [PATCH v2] Fix use of results after being unmapped Yann Sionneau
2019-06-14  9:25 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox