diff --git a/utils/cpuload/conn.go b/utils/cpuload/conn.go index d57b0e8b..cc42dfe1 100644 --- a/utils/cpuload/conn.go +++ b/utils/cpuload/conn.go @@ -85,7 +85,10 @@ func (self *Connection) WriteMessage(msg syscall.NetlinkMessage) error { } func (self *Connection) ReadMessage() (msg syscall.NetlinkMessage, err error) { - binary.Read(self.rbuf, binary.LittleEndian, &msg.Header) + err = binary.Read(self.rbuf, binary.LittleEndian, &msg.Header) + if err != nil { + return msg, err + } msg.Data = make([]byte, msg.Header.Len-syscall.NLMSG_HDRLEN) _, err = self.rbuf.Read(msg.Data) return msg, err diff --git a/utils/cpuload/netlink.go b/utils/cpuload/netlink.go index d4655d41..0353ee2b 100644 --- a/utils/cpuload/netlink.go +++ b/utils/cpuload/netlink.go @@ -76,7 +76,10 @@ func getFamilyId(conn *Connection) (uint16, error) { msg := prepareFamilyMessage() conn.WriteMessage(msg.toRawMsg()) - resp, _ := conn.ReadMessage() + resp, err := conn.ReadMessage() + if err != nil { + return 0, err + } id, err := parseFamilyResp(resp) if err != nil { return 0, err