Bluetooth: Only set ack_timer if we didn't send and ack
authorGustavo F. Padovan <padovan@profusion.mobi>
Thu, 23 Jun 2011 22:30:48 +0000 (19:30 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Thu, 10 Nov 2011 22:43:31 +0000 (20:43 -0200)
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/l2cap_core.c

index 43395089d30f886409eaee185cf6c812aa652ae0..1790ce3230bbeccc9cd1ccb33d3a43e9786af74d 100644 (file)
@@ -3928,11 +3928,12 @@ expected:
                        l2cap_retransmit_frames(chan);
        }
 
-       __set_ack_timer(chan);
 
        chan->num_acked = (chan->num_acked + 1) % num_to_ack;
        if (chan->num_acked == num_to_ack - 1)
                l2cap_send_ack(chan);
+       else
+               __set_ack_timer(chan);
 
        return 0;