]> git.baikalelectronics.ru Git - kernel.git/commit
tty: n_gsm: fix wrong modem processing in convergence layer type 2
authordaniel.starke@siemens.com <daniel.starke@siemens.com>
Fri, 18 Feb 2022 07:31:22 +0000 (23:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Feb 2022 18:51:04 +0000 (19:51 +0100)
commit32add963e534758e898b6e4f44097d38eaada760
treebda22305006ff19bd9a8bcc6ddc859529a809013
parent5118868b6c9d5dc45f88bd943d59c8a020accffe
tty: n_gsm: fix wrong modem processing in convergence layer type 2

The function gsm_process_modem() exists to handle modem status bits of
incoming frames. This includes incoming MSC (modem status command) frames
and convergence layer type 2 data frames. The function, however, was only
designed to handle MSC frames as it expects the command length. Within
gsm_dlci_data() it is wrongly assumed that this is the same as the data
frame length. This is only true if the data frame contains only 1 byte of
payload.

This patch names the length parameter of gsm_process_modem() in a generic
manner to reflect its association. It also corrects all calls to the
function to handle the variable number of modem status octets correctly in
both cases.

Fixes: 62d136575f6a ("tty: n_gsm: Fixed logic to decode break signal from modem status")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220218073123.2121-6-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c