summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-09-21 22:44:29 +0000
committergVisor bot <gvisor-bot@google.com>2021-09-21 22:44:29 +0000
commit9f386d85fdba31791102717b390adc74c839a2fa (patch)
treeeb4a7e7389d7584d882c479ed0cf61aad25be807 /pkg/sentry
parent11acecfe692f6de652ed94343618dfcd9324af94 (diff)
parentc485602ded3982f8fd1078e34a4b298879f1807e (diff)
Merge release-20210906.0-53-gc485602de (automated)
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/socket/unix/transport/queue.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/sentry/socket/unix/transport/queue.go b/pkg/sentry/socket/unix/transport/queue.go
index a9cedcf5f..188ad3bd9 100644
--- a/pkg/sentry/socket/unix/transport/queue.go
+++ b/pkg/sentry/socket/unix/transport/queue.go
@@ -59,12 +59,14 @@ func (q *queue) Close() {
// q.WriterQueue.Notify(waiter.WritableEvents)
func (q *queue) Reset(ctx context.Context) {
q.mu.Lock()
- for cur := q.dataList.Front(); cur != nil; cur = cur.Next() {
- cur.Release(ctx)
- }
+ dataList := q.dataList
q.dataList.Reset()
q.used = 0
q.mu.Unlock()
+
+ for cur := dataList.Front(); cur != nil; cur = cur.Next() {
+ cur.Release(ctx)
+ }
}
// DecRef implements RefCounter.DecRef.