]> git.baikalelectronics.ru Git - kernel.git/commit
tty: serial: fsl_lpuart: adjust buffer length to the intended size
authorShenwei Wang <shenwei.wang@nxp.com>
Mon, 10 Apr 2023 19:55:55 +0000 (14:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:49 +0000 (11:35 +0200)
commit78daf3b58770c51d9c1ef765853c64defcfc8bc3
treebbaee72150817deba9a6804430c3dcd5d37b9f20
parent58d053304eb9b4902aa16a020592f639a8740411
tty: serial: fsl_lpuart: adjust buffer length to the intended size

[ Upstream commit f73fd750552524b06b5d77ebfdd106ccc8fcac61 ]

Based on the fls function definition provided below, we should not
subtract 1 to obtain the correct buffer length:

fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.

Fixes: 5e091770f9c5 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx")
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Link: https://lore.kernel.org/r/20230410195555.1003900-1-shenwei.wang@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/fsl_lpuart.c