summaryrefslogtreecommitdiffstats
path: root/arch/tile/mm/homecache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-09 17:08:57 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-09 17:08:57 +0100
commit53523d5263dce1a3e3662c612f7050a4569071ad (patch)
treebc2ec3f77fcead18065c9642f456d9f6f50eb725 /arch/tile/mm/homecache.c
parentMerge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/j... (diff)
parentarch/tile: use new generic {enable,disable}_percpu_irq() routines (diff)
downloadlinux-53523d5263dce1a3e3662c612f7050a4569071ad.tar.xz
linux-53523d5263dce1a3e3662c612f7050a4569071ad.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: arch/tile: use new generic {enable,disable}_percpu_irq() routines drivers/net/ethernet/tile: use skb_frag_page() API asm-generic/unistd.h: support new process_vm_{readv,write} syscalls arch/tile: fix double-free bug in homecache_free_pages() arch/tile: add a few #includes and an EXPORT to catch up with kernel changes.
Diffstat (limited to 'arch/tile/mm/homecache.c')
-rw-r--r--arch/tile/mm/homecache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/tile/mm/homecache.c b/arch/tile/mm/homecache.c
index cbe6f4f9eca3..1cc6ae477c98 100644
--- a/arch/tile/mm/homecache.c
+++ b/arch/tile/mm/homecache.c
@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order)
VM_BUG_ON(!virt_addr_valid((void *)addr));
page = virt_to_page((void *)addr);
if (put_page_testzero(page)) {
- int pages = (1 << order);
homecache_change_page_home(page, order, initial_page_home());
- while (pages--)
- __free_page(page++);
+ if (order == 0) {
+ free_hot_cold_page(page, 0);
+ } else {
+ init_page_count(page);
+ __free_pages(page, order);
+ }
}
}