Bluetooth: RFCOMM: Remove send DM from drop()
rfcomm_dlc_drop() can be used from many places to unlink dlc from session and destroy it. So it is better to send DM explicitly from relevant places. Change-Id: I9b6a31ce5bb65b90510aa483539d4a201ba12b60 Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This commit is contained in:
parent
f0186d716d
commit
e36d58e593
1 changed files with 2 additions and 3 deletions
|
@ -607,9 +607,6 @@ static void rfcomm_dlc_drop(struct bt_rfcomm_dlc *dlc)
|
|||
{
|
||||
BT_DBG("dlc %p", dlc);
|
||||
|
||||
if (dlc->role == BT_RFCOMM_ROLE_ACCEPTOR) {
|
||||
rfcomm_send_dm(dlc->session, dlc->dlci);
|
||||
}
|
||||
rfcomm_dlcs_remove_dlci(dlc->session->dlcs, dlc->dlci);
|
||||
rfcomm_dlc_destroy(dlc);
|
||||
}
|
||||
|
@ -645,6 +642,7 @@ static void rfcomm_handle_sabm(struct bt_rfcomm_session *session, uint8_t dlci)
|
|||
break;
|
||||
case RFCOMM_SECURITY_REJECT:
|
||||
default:
|
||||
rfcomm_send_dm(session, dlci);
|
||||
rfcomm_dlc_drop(dlc);
|
||||
return;
|
||||
}
|
||||
|
@ -1068,6 +1066,7 @@ static void rfcomm_encrypt_change(struct bt_l2cap_chan *chan,
|
|||
|
||||
if (hci_status || !conn->encrypt ||
|
||||
conn->sec_level < dlc->required_sec_level) {
|
||||
rfcomm_send_dm(session, dlc->dlci);
|
||||
rfcomm_dlc_drop(dlc);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue