xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] xenmon: close qos_fd when finished with it in alloc_qos_data
@ 2016-02-10 16:26 Ian Campbell
  2016-02-10 16:26 ` [PATCH 2/2] xenmon: initialise dummy array Ian Campbell
  2016-02-11 11:18 ` [PATCH 1/2] xenmon: close qos_fd when finished with it in alloc_qos_data Wei Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Campbell @ 2016-02-10 16:26 UTC (permalink / raw)
  To: ian.jackson, wei.liu2, xen-devel; +Cc: Ian Campbell

Otherwise the fd is leaked. NB the mmap'd memory in the global
cpu_qos_data[n] is not affected by closing the underlying fd.

Compile tested only.

CID: 1055930

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenmon/xenbaked.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index eacacb0..782f0c1 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -689,6 +689,7 @@ static void alloc_qos_data(int ncpu)
         cpu_qos_data[n] = new_qos;
     }
     free(dummy);
+    close(qos_fd);
     new_qos = NULL;
 }
 
-- 
2.1.4

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

end of thread, other threads:[~2016-02-11 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 16:26 [PATCH 1/2] xenmon: close qos_fd when finished with it in alloc_qos_data Ian Campbell
2016-02-10 16:26 ` [PATCH 2/2] xenmon: initialise dummy array Ian Campbell
2016-02-11 11:19   ` Wei Liu
2016-02-11 11:18 ` [PATCH 1/2] xenmon: close qos_fd when finished with it in alloc_qos_data Wei Liu
2016-02-11 15:38   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).