Commit fad052dc authored by Chris Metcalf's avatar Chris Metcalf

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: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 4a556f4f
...@@ -568,7 +568,7 @@ void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, ...@@ -568,7 +568,7 @@ void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
addr = area->addr; addr = area->addr;
if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
phys_addr, pgprot)) { phys_addr, pgprot)) {
remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); free_vm_area(area);
return NULL; return NULL;
} }
return (__force void __iomem *) (offset + (char *)addr); return (__force void __iomem *) (offset + (char *)addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment