diff options
-rw-r--r-- | net/bluetooth/l2cap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index f9e4da2677af..4c7b2d22faa5 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -3546,7 +3546,8 @@ expected: | |||
3546 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) | 3546 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) |
3547 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; | 3547 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; |
3548 | else { | 3548 | else { |
3549 | sk->sk_send_head = TX_QUEUE(sk)->next; | 3549 | if (!skb_queue_empty(TX_QUEUE(sk))) |
3550 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3550 | pi->next_tx_seq = pi->expected_ack_seq; | 3551 | pi->next_tx_seq = pi->expected_ack_seq; |
3551 | l2cap_ertm_send(sk); | 3552 | l2cap_ertm_send(sk); |
3552 | } | 3553 | } |
@@ -3593,7 +3594,8 @@ static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control) | |||
3593 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) | 3594 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) |
3594 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; | 3595 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; |
3595 | else { | 3596 | else { |
3596 | sk->sk_send_head = TX_QUEUE(sk)->next; | 3597 | if (!skb_queue_empty(TX_QUEUE(sk))) |
3598 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3597 | pi->next_tx_seq = pi->expected_ack_seq; | 3599 | pi->next_tx_seq = pi->expected_ack_seq; |
3598 | l2cap_ertm_send(sk); | 3600 | l2cap_ertm_send(sk); |
3599 | } | 3601 | } |
@@ -3625,12 +3627,14 @@ static inline void l2cap_data_channel_rejframe(struct sock *sk, u16 rx_control) | |||
3625 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) | 3627 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) |
3626 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; | 3628 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; |
3627 | else { | 3629 | else { |
3628 | sk->sk_send_head = TX_QUEUE(sk)->next; | 3630 | if (!skb_queue_empty(TX_QUEUE(sk))) |
3631 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3629 | pi->next_tx_seq = pi->expected_ack_seq; | 3632 | pi->next_tx_seq = pi->expected_ack_seq; |
3630 | l2cap_ertm_send(sk); | 3633 | l2cap_ertm_send(sk); |
3631 | } | 3634 | } |
3632 | } else { | 3635 | } else { |
3633 | sk->sk_send_head = TX_QUEUE(sk)->next; | 3636 | if (!skb_queue_empty(TX_QUEUE(sk))) |
3637 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3634 | pi->next_tx_seq = pi->expected_ack_seq; | 3638 | pi->next_tx_seq = pi->expected_ack_seq; |
3635 | l2cap_ertm_send(sk); | 3639 | l2cap_ertm_send(sk); |
3636 | 3640 | ||