diff options
Diffstat (limited to 'pkg/sentry/device/device.go')
-rw-r--r-- | pkg/sentry/device/device.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/device/device.go b/pkg/sentry/device/device.go index 47945d1a7..f45b2bd2b 100644 --- a/pkg/sentry/device/device.go +++ b/pkg/sentry/device/device.go @@ -19,10 +19,10 @@ package device import ( "bytes" "fmt" - "sync" "sync/atomic" "gvisor.dev/gvisor/pkg/abi/linux" + "gvisor.dev/gvisor/pkg/sync" ) // Registry tracks all simple devices and related state on the system for @@ -188,6 +188,9 @@ type MultiDevice struct { // String stringifies MultiDevice. func (m *MultiDevice) String() string { + m.mu.Lock() + defer m.mu.Unlock() + buf := bytes.NewBuffer(nil) buf.WriteString("cache{") for k, v := range m.cache { |