diff options
author | Tamir Duberstein <tamird@google.com> | 2019-08-15 11:56:44 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-15 11:58:16 -0700 |
commit | fe74bba2bd8b3bed84f456313275500fca90f441 (patch) | |
tree | 7f8d2dc93d5c69c740283a433634f535a0e79b43 /pkg/tcpip/transport/raw | |
parent | 816a9211e96b3eabe7bead7fa625831fe8d2fbf8 (diff) |
Don't dereference errors passed to panic()
These errors are always pointers; there's no sense in dereferencing them
in the panic call. Changed one false positive for clarity.
PiperOrigin-RevId: 263611579
Diffstat (limited to 'pkg/tcpip/transport/raw')
-rw-r--r-- | pkg/tcpip/transport/raw/endpoint_state.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint_state.go b/pkg/tcpip/transport/raw/endpoint_state.go index a3d6f4580..168953dec 100644 --- a/pkg/tcpip/transport/raw/endpoint_state.go +++ b/pkg/tcpip/transport/raw/endpoint_state.go @@ -75,7 +75,7 @@ func (ep *endpoint) Resume(s *stack.Stack) { var err *tcpip.Error ep.route, err = ep.stack.FindRoute(ep.registeredNIC, ep.boundAddr, ep.route.RemoteAddress, ep.netProto, false) if err != nil { - panic(*err) + panic(err) } } @@ -87,6 +87,6 @@ func (ep *endpoint) Resume(s *stack.Stack) { } if err := ep.stack.RegisterRawTransportEndpoint(ep.registeredNIC, ep.netProto, ep.transProto, ep); err != nil { - panic(*err) + panic(err) } } |