summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTedd Ho-Jeong An <hj.tedd.an@gmail.com>2020-11-20 12:07:12 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-11-24 13:03:47 -0800
commit9b6f88b384f9634e50aaf7ca804ca39fe2224b72 (patch)
tree9a680c8a5e0e64b67a490be1e727d14b53b0b6ba /lib
parent4b16d594be1134d287b0fb5d83c4c8c73c8427be (diff)
downloadbluez-9b6f88b384f9634e50aaf7ca804ca39fe2224b72.tar.gz
lib: Fix the unchecked return value
This patch fixes the unchecked return value.
Diffstat (limited to 'lib')
-rw-r--r--lib/hci.c6
-rw-r--r--lib/sdp.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/hci.c b/lib/hci.c
index 4bd33f241..53af0a114 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -1246,12 +1246,14 @@ int hci_send_req(int dd, struct hci_request *r, int to)
failed:
err = errno;
- setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of));
+ if (setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of)) < 0)
+ err = errno;
errno = err;
return -1;
done:
- setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of));
+ if (setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of)) < 0)
+ return -1;
return 0;
}
diff --git a/lib/sdp.c b/lib/sdp.c
index ebaed3e40..844ae0d25 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -4705,7 +4705,8 @@ static int sdp_connect_l2cap(const bdaddr_t *src,
if (flags & SDP_WAIT_ON_CLOSE) {
struct linger l = { .l_onoff = 1, .l_linger = 1 };
- setsockopt(sk, SOL_SOCKET, SO_LINGER, &l, sizeof(l));
+ if (setsockopt(sk, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0)
+ return -1;
}
if ((flags & SDP_LARGE_MTU) &&