If not unmap memory after writing operating done, removing zram module
will fail due to the device is still in use. This patch fixes this
issue.

Signed-off-by: Caspar Zhang <cas...@casparzhang.com>
---
 testcases/kernel/mem/zram/zram01.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/mem/zram/zram01.c b/testcases/kernel/mem/zram/zram01.c
index 1dd7817..6967bd1 100644
--- a/testcases/kernel/mem/zram/zram01.c
+++ b/testcases/kernel/mem/zram/zram01.c
@@ -108,6 +108,10 @@ static void write_device(void)
 
 	tst_resm(TINFO, "write all the memory.");
 	memset(s, 'a', SIZE);
+
+	if (munmap(s, SIZE) == -1)
+		tst_brkm(TBROK|TERRNO, cleanup, "munmap");
+
 	close(fd);
 }
 
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to