From: Loic Poulain Date: Fri, 8 Aug 2014 17:07:16 +0000 (+0200) Subject: Bluetooth: Fix HCI H5 corrupted ack value X-Git-Tag: fixes-against-v3.18-rc2~81^2~133^2~84^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4807b51895dce8aa650ebebc51fa4a795ed6b8b8;p=pandora-kernel.git Bluetooth: Fix HCI H5 corrupted ack value In this expression: seq = (seq - 1) % 8 seq (u8) is implicitly converted to an int in the arithmetic operation. So if seq value is 0, operation is ((0 - 1) % 8) => (-1 % 8) => -1. The new seq value is 0xff which is an invalid ACK value, we expect 0x07. It leads to frequent dropped ACK and retransmission. Fix this by using '&' binary operator instead of '%'. Signed-off-by: Loic Poulain Signed-off-by: Marcel Holtmann Cc: stable@vger.kernel.org --- Reading git-diff-tree failed