]> 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>
Thu, 25 Aug 2022 09:18:03 +0000 (11:18 +0200)
commit8b81807eb41fab6a82b2cbae2bae6bdc2d7a09ce
tree6e881e02cc67fb976b2e1a4ae6fdcc2f37c39e13
parente39c71ef275e7d12b45f5cacf3d18dabca49e96f
tty: n_gsm: fix missing corner cases in gsmld_poll()

[ Upstream commit 8a23cabd919feec881affea7a33b690430679567 ]

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