diff mbox series

[BlueZ,1/1] att: Correctly handle negative return values in can_write_data

Message ID 20240827080925.55684-1-xiaokeqinhealth@126.com
State New
Headers show
Series [BlueZ,1/1] att: Correctly handle negative return values in can_write_data | expand

Commit Message

Felix Qin Aug. 27, 2024, 8:09 a.m. UTC
From: Felix Qin <xiaoyao@rock-chips.com>

---
 src/shared/att.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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);