From 6e0c46445bd15c5324440abd913a651d1d3f7410 Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Mon, 11 May 2020 17:01:28 +0200 Subject: [PATCH] Skip null ports --- infiniband/netdiscover.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/infiniband/netdiscover.go b/infiniband/netdiscover.go index 24bb0f6..555ce6d 100644 --- a/infiniband/netdiscover.go +++ b/infiniband/netdiscover.go @@ -273,6 +273,9 @@ func (n *ibndNode) walkPorts(mad_port *C.struct_ibmad_port, resetThreshold uint) // Get pointer to port struct at portNum array offset pp := *(**C.ibnd_port_t)(unsafe.Pointer(arrayPtr + unsafe.Sizeof(arrayPtr)*uintptr(portNum))) + if pp == nil { + continue + } myPort := Port{GUID: uint64(pp.guid)}