summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/mm
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/mm')
-rwxr-xr-xpkg/sentry/mm/io_list.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/sentry/mm/io_list.go b/pkg/sentry/mm/io_list.go
index ecb9d4b04..287e4305c 100755
--- a/pkg/sentry/mm/io_list.go
+++ b/pkg/sentry/mm/io_list.go
@@ -135,8 +135,9 @@ func (l *ioList) InsertBefore(a, e *ioResult) {
// Remove removes e from l.
func (l *ioList) Remove(e *ioResult) {
- prev := ioElementMapper{}.linkerFor(e).Prev()
- next := ioElementMapper{}.linkerFor(e).Next()
+ linker := ioElementMapper{}.linkerFor(e)
+ prev := linker.Prev()
+ next := linker.Next()
if prev != nil {
ioElementMapper{}.linkerFor(prev).SetNext(next)
@@ -149,6 +150,9 @@ func (l *ioList) Remove(e *ioResult) {
} else {
l.tail = prev
}
+
+ linker.SetNext(nil)
+ linker.SetPrev(nil)
}
// Entry is a default implementation of Linker. Users can add anonymous fields