From 44bf1db573c623069f52b09659c1da57589d4e16 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Tue, 12 May 2009 18:24:31 +0300 Subject: [PATCH] Removed the BUG() check on a legitimate l4_unmap return case When vmas are unmapped before being touched, l4_unmap may return a negative value if the unmapped area was already faulted. This is normal behaviour --- tasks/mm0/src/munmap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tasks/mm0/src/munmap.c b/tasks/mm0/src/munmap.c index 35cd93d..e5b5c29 100644 --- a/tasks/mm0/src/munmap.c +++ b/tasks/mm0/src/munmap.c @@ -93,9 +93,13 @@ int vma_destroy_single(struct tcb *task, struct vm_area *vma) if ((ret = vma_drop_merge_delete_all(vma)) < 0) return ret; - /* Unmap the whole vma address range */ - BUG_ON(l4_unmap((void *)__pfn_to_addr(vma->pfn_start), - vma->pfn_end - vma->pfn_start, task->tid) < 0); + /* + * Unmap the whole vma address range. Note that this + * may return -1 if the area was already faulted, which + * means the area was unmapped before being touched. + */ + l4_unmap((void *)__pfn_to_addr(vma->pfn_start), + vma->pfn_end - vma->pfn_start, task->tid); /* Unlink and delete vma */ list_del(&vma->list);