mirror of https://gitee.com/openkylin/linux.git
Bluetooth: Fix L2CAP channel closing for LE connections
Sending of the L2CAP Disconnect request should also be performed for LE based channels. The proper thing to do is therefore to look at whether there's a PSM specified for the channel instead of looking at the link type. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
27e2d4c8d2
commit
cea04ce35e
|
@ -674,8 +674,10 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason)
|
||||||
|
|
||||||
case BT_CONNECTED:
|
case BT_CONNECTED:
|
||||||
case BT_CONFIG:
|
case BT_CONFIG:
|
||||||
if (chan->chan_type == L2CAP_CHAN_CONN_ORIENTED &&
|
/* ATT uses L2CAP_CHAN_CONN_ORIENTED so we must also
|
||||||
conn->hcon->type == ACL_LINK) {
|
* check for chan->psm.
|
||||||
|
*/
|
||||||
|
if (chan->chan_type == L2CAP_CHAN_CONN_ORIENTED && chan->psm) {
|
||||||
__set_chan_timer(chan, chan->ops->get_sndtimeo(chan));
|
__set_chan_timer(chan, chan->ops->get_sndtimeo(chan));
|
||||||
l2cap_send_disconn_req(chan, reason);
|
l2cap_send_disconn_req(chan, reason);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in New Issue