From: Pekka Paalanen Date: Tue, 16 Sep 2008 18:54:16 +0000 (+0300) Subject: x86 mmiotrace: fix a rare memory leak X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bbe5c7830c6dbde58726d44ec0337bc8b2d95d37;p=linux-beck.git x86 mmiotrace: fix a rare memory leak Signed-off-by: Pekka Paalanen Acked-by: Steven Rostedt Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index 635b50e85581..754bd1eaf4f6 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -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);