summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform
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/platform
parent12c161f27865d0e389cd593c669bd740d7f24692 (diff)
Remove error return from AddressSpace.Release()
PiperOrigin-RevId: 196291289 Change-Id: Ie3487be029850b0b410b82416750853a6c4a2b00
Diffstat (limited to 'pkg/sentry/platform')
-rw-r--r--pkg/sentry/platform/kvm/address_space.go3
-rw-r--r--pkg/sentry/platform/platform.go2
-rw-r--r--pkg/sentry/platform/ptrace/subprocess.go3
3 files changed, 3 insertions, 5 deletions
diff --git a/pkg/sentry/platform/kvm/address_space.go b/pkg/sentry/platform/kvm/address_space.go
index a4b9198cc..173885867 100644
--- a/pkg/sentry/platform/kvm/address_space.go
+++ b/pkg/sentry/platform/kvm/address_space.go
@@ -200,8 +200,7 @@ func (as *addressSpace) Unmap(addr usermem.Addr, length uint64) {
}
// Release releases the page tables.
-func (as *addressSpace) Release() error {
+func (as *addressSpace) Release() {
as.Unmap(0, ^uint64(0))
as.pageTables.Release()
- return nil
}
diff --git a/pkg/sentry/platform/platform.go b/pkg/sentry/platform/platform.go
index 6219dada7..1c385bc5a 100644
--- a/pkg/sentry/platform/platform.go
+++ b/pkg/sentry/platform/platform.go
@@ -205,7 +205,7 @@ type AddressSpace interface {
// Release releases this address space. After releasing, a new AddressSpace
// must be acquired via platform.NewAddressSpace().
- Release() error
+ Release()
// AddressSpaceIO methods are supported iff the associated platform's
// Platform.SupportsAddressSpaceIO() == true. AddressSpaces for which this
diff --git a/pkg/sentry/platform/ptrace/subprocess.go b/pkg/sentry/platform/ptrace/subprocess.go
index 0d6a38f15..035ebc332 100644
--- a/pkg/sentry/platform/ptrace/subprocess.go
+++ b/pkg/sentry/platform/ptrace/subprocess.go
@@ -242,14 +242,13 @@ func (s *subprocess) unmap() {
// Therefore we simply unmap everything in the subprocess and return it to the
// globalPool. This has the added benefit of reducing creation time for new
// subprocesses.
-func (s *subprocess) Release() error {
+func (s *subprocess) Release() {
go func() { // S/R-SAFE: Platform.
s.unmap()
globalPool.mu.Lock()
globalPool.available = append(globalPool.available, s)
globalPool.mu.Unlock()
}()
- return nil
}
// newThread creates a new traced thread.