diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-07 15:42:34 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-13 16:26:25 -0400 |
commit | fad052dc4be7b1d9e7ff40ccd8ba2b8216823b51 (patch) | |
tree | 8c797b21480c322dab8542e8a5d851b014496c70 /arch/tile/mm | |
parent | 4a556f4f56da3110b27e265b79f0e7582115445c (diff) |
tile: avoid struct vm_struct leak
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>
Diffstat (limited to 'arch/tile/mm')
-rw-r--r-- | arch/tile/mm/pgtable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/tile/mm/pgtable.c b/arch/tile/mm/pgtable.c index dfd63ce87327..2bd572be9dba 100644 --- a/arch/tile/mm/pgtable.c +++ b/arch/tile/mm/pgtable.c | |||
@@ -568,7 +568,7 @@ void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, | |||
568 | addr = area->addr; | 568 | addr = area->addr; |
569 | if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, | 569 | if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, |
570 | phys_addr, pgprot)) { | 570 | phys_addr, pgprot)) { |
571 | remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); | 571 | free_vm_area(area); |
572 | return NULL; | 572 | return NULL; |
573 | } | 573 | } |
574 | return (__force void __iomem *) (offset + (char *)addr); | 574 | return (__force void __iomem *) (offset + (char *)addr); |