We also tested the memobj r0 patch which is already committed to vbox 
trunk
in the FreeBSD port and found some bugs. Here are the fixes for them.

The Author agrees that those 4 patches are under MIT License.

-- 
Bernhard Fröhlich
http://www.bluelife.at/

-------- Original Message --------
Subject: [PATCH] avoid double deallocation of vm_object after 
vm_map_remove
Date: 09.03.2012 22:56
 From: Andriy Gapon <[email protected]>
To: Bernhard Froehlich <[email protected]>

Signed-off-by: Andriy Gapon <[email protected]>

---
  .../Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c   |    8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 
b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
index 75427ab..5c04e7f 100644
--- a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
@@ -287,9 +287,11 @@ static int 
rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFREEBSD pMemFreeBSD, bool fEx

          vm_map_remove(kernel_map, MapAddress, MapAddress + 
pMemFreeBSD->Core.cb);
      }
-    rc = rcNoMem; /** @todo fix translation (borrow from darwin) */
-
-    vm_object_deallocate(pMemFreeBSD->pObject);
+    else
+    {
+        rc = rcNoMem; /** @todo fix translation (borrow from darwin) 
*/
+        vm_object_deallocate(pMemFreeBSD->pObject);
+    }
      rtR0MemObjDelete(&pMemFreeBSD->Core);
      return rc;
  }

_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to