All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [FIX PATCH] numa: Fix memory leak in numa_set_mem_node_id()
@ 2015-07-09 15:27 Bharata B Rao
  2015-07-09 15:36 ` Eduardo Habkost
  0 siblings, 1 reply; 2+ messages in thread
From: Bharata B Rao @ 2015-07-09 15:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, ehabkost, mst, Bharata B Rao, imammedo, pbonzini,
	Bharata B Rao, david

Fix a memory leak in numa_set_mem_node_id().

Signed-off-by: Bharata B Rao <bharata@linux.vnet.com>
---
 numa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/numa.c b/numa.c
index 3c80059..402804b 100644
--- a/numa.c
+++ b/numa.c
@@ -54,7 +54,7 @@ NodeInfo numa_info[MAX_NODES];
 
 void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node)
 {
-    struct numa_addr_range *range = g_malloc0(sizeof(*range));
+    struct numa_addr_range *range;
 
     /*
      * Memory-less nodes can come here with 0 size in which case,
@@ -64,6 +64,7 @@ void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node)
         return;
     }
 
+    range = g_malloc0(sizeof(*range));
     range->mem_start = addr;
     range->mem_end = addr + size - 1;
     QLIST_INSERT_HEAD(&numa_info[node].addr, range, entry);
-- 
2.1.0

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

* Re: [Qemu-devel] [FIX PATCH] numa: Fix memory leak in numa_set_mem_node_id()
  2015-07-09 15:27 [Qemu-devel] [FIX PATCH] numa: Fix memory leak in numa_set_mem_node_id() Bharata B Rao
@ 2015-07-09 15:36 ` Eduardo Habkost
  0 siblings, 0 replies; 2+ messages in thread
From: Eduardo Habkost @ 2015-07-09 15:36 UTC (permalink / raw)
  To: Bharata B Rao
  Cc: peter.maydell, mst, qemu-devel, imammedo, pbonzini, Bharata B Rao, david

On Thu, Jul 09, 2015 at 08:57:36PM +0530, Bharata B Rao wrote:
> Fix a memory leak in numa_set_mem_node_id().
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

Applied to the NUMA tree. Thanks!

-- 
Eduardo

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

end of thread, other threads:[~2015-07-09 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 15:27 [Qemu-devel] [FIX PATCH] numa: Fix memory leak in numa_set_mem_node_id() Bharata B Rao
2015-07-09 15:36 ` Eduardo Habkost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.