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>
Fri, 8 Jul 2022 13:14:53 +0000 (15:14 +0200)
commit7e5b4322cde067e1d0f1bf8f490e93f664a7c843
treededd8fcee6a8431c32f000862162e37bc1cf73a7
parent59ff0680ecbfec742b1e0381e7cc46b41eb06647
tty: n_gsm: fix missing corner cases in gsmld_poll()

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: e1eaea46bb40 ("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>
drivers/tty/n_gsm.c