@@ -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;
}
@@ -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) &&