From 32a0811685c5dd290f1152bef2dfbde3b2848446 Mon Sep 17 00:00:00 2001 From: Felix Qin Date: Tue, 27 Aug 2024 16:09:25 +0800 Subject: [PATCH] att: Correctly handle negative return values in can_write_data --- src/shared/att.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/att.c b/src/shared/att.c index a45e9c268..4a406f4b9 100644 --- a/src/shared/att.c +++ b/src/shared/att.c @@ -551,7 +551,7 @@ static bool can_write_data(struct io *io, void *user_data) if (!op) return false; - if (!bt_att_chan_write(chan, op->opcode, op->pdu, op->len)) { + if (bt_att_chan_write(chan, op->opcode, op->pdu, op->len) < 0) { if (op->callback) op->callback(BT_ATT_OP_ERROR_RSP, NULL, 0, op->user_data); -- 2.47.3