nimble/host: Fix invalid connection handle usage

'0' is a valid connection handle, we need to return proper symbol if
there is no connection found.

X-Original-Commit: e5a7f8ac1b9b13018c01d2f69b08d20bc6f33aa9
This commit is contained in:
Andrzej Kaczmarek
2017-12-15 10:23:54 +01:00
parent f91703f6db
commit 6de52d252a
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -471,7 +471,7 @@ ble_att_rx(struct ble_l2cap_chan *chan)
int rc;
conn_handle = ble_l2cap_get_conn_handle(chan);
if (!conn_handle) {
if (conn_handle == BLE_HS_CONN_HANDLE_NONE) {
return BLE_HS_ENOTCONN;
}
+1 -1
View File
@@ -135,7 +135,7 @@ uint16_t
ble_l2cap_get_conn_handle(struct ble_l2cap_chan *chan)
{
if (!chan) {
return 0;
return BLE_HS_CONN_HANDLE_NONE;
}
return chan->conn_handle;
+1 -1
View File
@@ -2565,7 +2565,7 @@ ble_sm_rx(struct ble_l2cap_chan *chan)
STATS_INC(ble_l2cap_stats, sm_rx);
conn_handle = ble_l2cap_get_conn_handle(chan);
if (!conn_handle) {
if (conn_handle == BLE_HS_CONN_HANDLE_NONE) {
return BLE_HS_ENOTCONN;
}