summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/mm/address_space.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-05-11 12:23:25 -0700
committerShentubot <shentubot@google.com>2018-05-11 12:24:15 -0700
commit8deabbaae1fc45b042d551891080deef866dc0f8 (patch)
tree23aff1527fcb4f352a639159b693264d1ddd0c4b /pkg/sentry/mm/address_space.go
parent12c161f27865d0e389cd593c669bd740d7f24692 (diff)
Remove error return from AddressSpace.Release()
PiperOrigin-RevId: 196291289 Change-Id: Ie3487be029850b0b410b82416750853a6c4a2b00
Diffstat (limited to 'pkg/sentry/mm/address_space.go')
-rw-r--r--pkg/sentry/mm/address_space.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/pkg/sentry/mm/address_space.go b/pkg/sentry/mm/address_space.go
index 4dd67b1ea..27554f163 100644
--- a/pkg/sentry/mm/address_space.go
+++ b/pkg/sentry/mm/address_space.go
@@ -114,12 +114,12 @@ func (mm *MemoryManager) Activate() error {
}
}
-// Deactivate releases a release to the MemoryManager.
-func (mm *MemoryManager) Deactivate() error {
+// Deactivate releases a reference to the MemoryManager.
+func (mm *MemoryManager) Deactivate() {
// Fast path: this is not the last goroutine to deactivate the
// MemoryManager.
if atomicbitops.DecUnlessOneInt32(&mm.active) {
- return nil
+ return
}
mm.activeMu.Lock()
@@ -128,26 +128,21 @@ func (mm *MemoryManager) Deactivate() error {
// Still active?
if atomic.AddInt32(&mm.active, -1) > 0 {
mm.activeMu.Unlock()
- return nil
+ return
}
// Can we hold on to the address space?
if !mm.p.CooperativelySchedulesAddressSpace() {
mm.activeMu.Unlock()
- return nil
+ return
}
// Release the address space.
- if err := mm.as.Release(); err != nil {
- atomic.StoreInt32(&mm.active, 1)
- mm.activeMu.Unlock()
- return err
- }
+ mm.as.Release()
// Lost it.
mm.as = nil
mm.activeMu.Unlock()
- return nil
}
// mapASLocked maps addresses in ar into mm.as. If precommit is true, mappings