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 <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2020-06-10 12:02:09 -07:00 committed by Carles Cufí
commit 3ae926c0f1

View file

@ -2902,8 +2902,8 @@ int bt_att_send(struct bt_conn *conn, struct net_buf *buf, bt_conn_tx_cb_t cb,
* cannot be used with a custom user_data.
*/
if (cb) {
bt_l2cap_send_cb(conn, BT_L2CAP_CID_ATT, buf, cb, user_data);
return 0;
return bt_l2cap_send_cb(conn, BT_L2CAP_CID_ATT, buf, cb,
user_data);
}
ret = 0;