diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-02-28 14:02:08 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-29 18:55:42 +0100 |
commit | b16bf712f491808a8c926dd481c696fe7d73ee5a (patch) | |
tree | 6508ef458acdf590ffec999845441d76f3a2f72a /arch | |
parent | f2dbe03dccc95f41429d60e4221b02fc0f112cc4 (diff) | |
download | linux-b16bf712f491808a8c926dd481c696fe7d73ee5a.tar.gz linux-b16bf712f491808a8c926dd481c696fe7d73ee5a.tar.bz2 linux-b16bf712f491808a8c926dd481c696fe7d73ee5a.zip |
x86: fix leak un ioremap_page_range() failure
Jan Beulich noticed it during code review that if a driver's ioremap()
fails (say due to -ENOMEM) then we might leak the struct vm_area.
Free it properly.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/ioremap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 882328efc3db..ac3c959e271d 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -162,7 +162,7 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, area->phys_addr = phys_addr; vaddr = (unsigned long) area->addr; if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) { - remove_vm_area((void *)(vaddr & PAGE_MASK)); + free_vm_area(area); return NULL; } |