Diff between 537f96a28399ad9a4140801575b384c8c5716bba and 605e078556d0a23b60e9a65b5db20334a544e738

Changed Files

File Additions Deletions Status
src/gatt-client.c +5 -0 modified

Full Patch

diff --git a/src/gatt-client.c b/src/gatt-client.c
index 60a21e3..8d83a95 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -1127,6 +1127,11 @@ static bool sock_read(struct io *io, void *user_data)
 	msg.msg_iov = &iov;
 	msg.msg_iovlen = 1;
 
+	if (fd < 0) {
+		error("io_get_fd() returned %d\n", fd);
+		return false;
+	}
+
 	bytes_read = recvmsg(fd, &msg, MSG_DONTWAIT);
 	if (bytes_read < 0) {
 		error("recvmsg: %s", strerror(errno));