Skip to content

Commit 3ae926c

Browse files
Vudentzcarlescufi
authored andcommitted
Bluetooth: ATT: Fix not returning error
bt_l2cap_send_cb may fail if there are no context available which means that the request would not be sent, also due to the use of custom callback it cannot be queued either so the only option is to return the error and let the application handle it. Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent bc7ce86 commit 3ae926c

File tree

1 file changed

+2
-2
lines changed
  • subsys/bluetooth/host

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/att.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,8 +2902,8 @@ int bt_att_send(struct bt_conn *conn, struct net_buf *buf, bt_conn_tx_cb_t cb,
29022902
* cannot be used with a custom user_data.
29032903
*/
29042904
if (cb) {
2905-
bt_l2cap_send_cb(conn, BT_L2CAP_CID_ATT, buf, cb, user_data);
2906-
return 0;
2905+
return bt_l2cap_send_cb(conn, BT_L2CAP_CID_ATT, buf, cb,
2906+
user_data);
29072907
}
29082908

29092909
ret = 0;

0 commit comments

Comments
 (0)