OSDN Git Service

serial: sh-sci: Fix crash in rx_timer_fn() on PIO fallback
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 13 Dec 2018 18:44:42 +0000 (19:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:23 +0000 (09:20 +0100)
commit3e30e75bc15663d6e5fd56290c5bd296b1086e0f
tree21e781a2a4d7e47a191755c704eeb42bee601e7b
parentdf3a72c9608ca74e9add4ac781a3613534bc585c
serial: sh-sci: Fix crash in rx_timer_fn() on PIO fallback

[ Upstream commit 2e948218b7c1262a3830823d6620eb227e3d4e3a ]

When falling back to PIO, active_rx must be set to a different value
than cookie_rx[i], else sci_dma_rx_find_active() will incorrectly find a
match, leading to a NULL pointer dereference in rx_timer_fn() later.

Use zero instead, which is the same value as after driver
initialization.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/sh-sci.c