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/icmp | |
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/icmp')
-rw-r--r-- | pkg/tcpip/transport/icmp/endpoint_state.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/icmp/endpoint_state.go b/pkg/tcpip/transport/icmp/endpoint_state.go index c5690174e..c587b96b6 100644 --- a/pkg/tcpip/transport/icmp/endpoint_state.go +++ b/pkg/tcpip/transport/icmp/endpoint_state.go @@ -78,7 +78,7 @@ func (e *endpoint) Resume(s *stack.Stack) { if e.state == stateConnected { e.route, err = e.stack.FindRoute(e.regNICID, e.bindAddr, e.id.RemoteAddress, e.netProto, false /* multicastLoop */) if err != nil { - panic(*err) + panic(err) } e.id.LocalAddress = e.route.LocalAddress @@ -90,6 +90,6 @@ func (e *endpoint) Resume(s *stack.Stack) { e.id, err = e.registerWithStack(e.regNICID, []tcpip.NetworkProtocolNumber{e.netProto}, e.id) if err != nil { - panic(*err) + panic(err) } } |