]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tty: serial: msm: Don't read off end of tx fifo
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 3 Jun 2016 00:48:28 +0000 (17:48 -0700)
committerNicolas Dechesne <nicolas.dechesne@linaro.org>
Wed, 8 Jun 2016 12:51:52 +0000 (14:51 +0200)
commit669bb32537e12cd5fc13f52d3e3fc8226aa6d61f
tree991154c00eb7e4b14e87eb91ef041d63228ae43c
parentc126e0bc2bdef5b1fca7c095e8ace1108086d7e1
tty: serial: msm: Don't read off end of tx fifo

For dm uarts in pio mode tx data is transferred to the fifo register 4
bytes at a time, but care is not taken when these 4 bytes spans the end
of the xmit buffer so the loop might read up to 3 bytes past the buffer
and then skip the actual data at the beginning of the buffer.

Fix this by, analogous to the DMA case, make sure the chunk doesn't
wrap the xmit buffer.

Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support")
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Ivan Ivanov <iivanov.xz@gmail.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: stable@vger.kernel.org
Reported-by: Frank Rowand <frowand.list@gmail.com>
Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/tty/serial/msm_serial.c