Bluetooth: ATT: Avoid warning when no ATT request is pending

Avoid warning in att_handle_rsp, only call this when there is a
pending ATT request. This avoids a warning happens when elevating
security fails but higher security had not been requested by an
ATT request.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>

squash! Bluetooth: ATT: Remove warning when no ATT process pending
This commit is contained in:
Joakim Andersson 2020-07-30 12:53:45 +02:00 committed by Carles Cufí
commit 42b4719947

View file

@ -2673,7 +2673,11 @@ static void bt_att_encrypt_change(struct bt_l2cap_chan *chan,
* outstanding request about security failure.
*/
if (hci_status) {
att_handle_rsp(att_chan, NULL, 0, BT_ATT_ERR_AUTHENTICATION);
if (att_chan->req) {
att_handle_rsp(att_chan, NULL, 0,
BT_ATT_ERR_AUTHENTICATION);
}
return;
}