tile: avoid struct vm_struct leak
authorChris Metcalf <cmetcalf@tilera.com>
Wed, 7 Aug 2013 19:42:34 +0000 (15:42 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Tue, 13 Aug 2013 20:26:25 +0000 (16:26 -0400)
If ioreamp_prot() fails in ioremap_page_range() due to kernel memory
exhaustion, we previously would leak a struct vm_struct.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/mm/pgtable.c

index dfd63ce..2bd572b 100644 (file)
@@ -568,7 +568,7 @@ void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
        addr = area->addr;
        if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
                               phys_addr, pgprot)) {
-               remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr));
+               free_vm_area(area);
                return NULL;
        }
        return (__force void __iomem *) (offset + (char *)addr);