summaryrefslogtreecommitdiffhomepage
path: root/device
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2021-02-09 08:15:21 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 18:28:55 +0100
commitecceaadd168ce682695acf1a5c004ef89e4927eb (patch)
tree671225a8e01dac79d2076855aabef8456c689d77 /device
parent9e728c2eb07e9d551bef2bcb3681ea0afc2dd1a0 (diff)
device: remove nil elem check in finalizers
This is not necessary, and removing it speeds up detection of UAF bugs. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to 'device')
-rw-r--r--device/channels.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/device/channels.go b/device/channels.go
index 1e3e206..bf78868 100644
--- a/device/channels.go
+++ b/device/channels.go
@@ -87,9 +87,6 @@ func newAutodrainingInboundQueue(device *Device) *autodrainingInboundQueue {
for {
select {
case elem := <-q.c:
- if elem == nil {
- continue
- }
elem.Lock()
device.PutMessageBuffer(elem.buffer)
device.PutInboundElement(elem)
@@ -118,9 +115,6 @@ func newAutodrainingOutboundQueue(device *Device) *autodrainingOutboundQueue {
for {
select {
case elem := <-q.c:
- if elem == nil {
- continue
- }
elem.Lock()
device.PutMessageBuffer(elem.buffer)
device.PutOutboundElement(elem)