]> git.baikalelectronics.ru Git - kernel.git/commit
tty: n_gsm: fix missing corner cases in gsmld_poll()
authorDaniel Starke <daniel.starke@siemens.com>
Thu, 7 Jul 2022 11:32:23 +0000 (13:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:06 +0000 (14:24 +0200)
commita9275f1e9d1e5d7442278c3fc52b298b819358ba
tree5efea3bd0877b00396a72c2532780fd81bbc7b1b
parentca6000202b9e50b8534a7a6ae383d0accfcabedd
tty: n_gsm: fix missing corner cases in gsmld_poll()

[ Upstream commit c71edbd18762c74cbaec386f60ad20c288f96525 ]

gsmld_poll() currently fails to handle the following corner cases correctly:
- remote party closed the associated tty

Add the missing checks and map those to EPOLLHUP.
Reorder the checks to group them by their reaction.

Fixes: 99551fa31543 ("tty: n_gsm line discipline")
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220707113223.3685-4-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/n_gsm.c