We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5dde9f6 + 6f64bf4 commit 8c5522fCopy full SHA for 8c5522f
linux/hci/socket/socket.go
@@ -74,6 +74,7 @@ func NewSocket(id int) (*Socket, error) {
74
75
req := devListRequest{devNum: hciMaxDevices}
76
if err = ioctl(uintptr(fd), hciGetDeviceList, uintptr(unsafe.Pointer(&req))); err != nil {
77
+ unix.Close(fd)
78
return nil, errors.Wrap(err, "can't get device list")
79
}
80
var msg string
@@ -84,6 +85,7 @@ func NewSocket(id int) (*Socket, error) {
84
85
86
msg = msg + fmt.Sprintf("(hci%d: %s)", id, err)
87
88
89
return nil, errors.Errorf("no devices available: %s", msg)
90
91
0 commit comments