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>
This commit is contained in:
Ingo Molnar 2008-02-28 14:02:08 +01:00
parent f2dbe03dcc
commit b16bf712f4
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}