x86 mmiotrace: fix a rare memory leak
authorPekka Paalanen <pq@iki.fi>
Tue, 16 Sep 2008 18:54:16 +0000 (21:54 +0300)
committerIngo Molnar <mingo@elte.hu>
Tue, 14 Oct 2008 08:37:01 +0000 (10:37 +0200)
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/mmio-mod.c

index 635b50e85581de29bc4a9d32ffbd82da6612838c..754bd1eaf4f6cb6174382f9f8a499999df72f7a8 100644 (file)
@@ -307,8 +307,10 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size,
        map.map_id = trace->id;
 
        spin_lock_irq(&trace_lock);
-       if (!is_enabled())
+       if (!is_enabled()) {
+               kfree(trace);
                goto not_enabled;
+       }
 
        mmio_trace_mapping(&map);
        list_add_tail(&trace->list, &trace_list);