]> git.baikalelectronics.ru Git - kernel.git/commit
tty: n_gsm: fix frame reception handling
authorDaniel Starke <daniel.starke@siemens.com>
Thu, 14 Apr 2022 09:42:11 +0000 (02:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 06:36:04 +0000 (08:36 +0200)
commit744ac8b2fc273f2d4c8e2aa6bcfef2f7bf25a3f9
treec10f3b3e244e9c6c15f1fc7260378dc2600a1ab1
parente5c4f82fb9dc2d51c9187cb90336d79d9f4a7c03
tty: n_gsm: fix frame reception handling

The frame checksum (FCS) is currently handled in gsm_queue() after
reception of a frame. However, this breaks layering. A workaround with
'received_fcs' was implemented so far.
Furthermore, frames are handled as such even if no end flag was received.
Move FCS calculation from gsm_queue() to gsm0_receive() and gsm1_receive().
Also delay gsm_queue() call there until a full frame was received to fix
both points.

Fixes: 99551fa31543 ("tty: n_gsm line discipline")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220414094225.4527-6-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c