summaryrefslogtreecommitdiff
path: root/mesh/mesh-io-unit.c
diff options
context:
space:
mode:
authorTedd Ho-Jeong An <tedd.an@intel.com>2021-10-18 10:28:31 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-10-18 15:31:55 -0700
commit799f6ff793250bbc692964d000429549803528a1 (patch)
tree44317566c9334fd2f3ed4c1eb64e63ca96766162 /mesh/mesh-io-unit.c
parentcd75918d2176e8978e1808f3fe67151c4e974437 (diff)
downloadbluez-799f6ff793250bbc692964d000429549803528a1.tar.gz
mesh: Fix unchecked return value
This patch fixes the unchecked return value(CWE-252) issues reported by the Coverity.
Diffstat (limited to 'mesh/mesh-io-unit.c')
-rw-r--r--mesh/mesh-io-unit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesh/mesh-io-unit.c b/mesh/mesh-io-unit.c
index c5aae6741..f4b615ac8 100644
--- a/mesh/mesh-io-unit.c
+++ b/mesh/mesh-io-unit.c
@@ -133,7 +133,8 @@ static bool incoming(struct l_io *sio, void *user_data)
buf[0] = 0;
memcpy(buf + 1, pvt->unique_name, size + 1);
- send(pvt->fd, buf, size + 2, MSG_DONTWAIT);
+ if (send(pvt->fd, buf, size + 2, MSG_DONTWAIT) < 0)
+ l_error("Failed to send(%d)", errno);
}
return true;
@@ -304,7 +305,8 @@ static bool simple_match(const void *a, const void *b)
static void send_pkt(struct mesh_io_private *pvt, struct tx_pkt *tx,
uint16_t interval)
{
- send(pvt->fd, tx->pkt, tx->len, MSG_DONTWAIT);
+ if (send(pvt->fd, tx->pkt, tx->len, MSG_DONTWAIT) < 0)
+ l_error("Failed to send(%d)", errno);
if (tx->delete) {
l_queue_remove_if(pvt->tx_pkts, simple_match, tx);