projects
/
wrapfs-4.9.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
478574e
)
tty: n_gsm: fix malformed counter for out of frame data
author
Daniel Starke
<daniel.starke@siemens.com>
Thu, 14 Apr 2022 09:42:12 +0000
(
02:42
-0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:14:56 +0000
(12:14 +0200)
commit
a24b4b2f660b7ddf3f484b37600bba382cb28a9d
upstream.
The gsm_mux field 'malformed' represents the number of malformed frames
received. However, gsm1_receive() also increases this counter for any out
of frame byte.
Fix this by ignoring out of frame data for the malformed counter.
Fixes: e1eaea46bb40 ("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-7-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c
patch
|
blob
|
history
diff --git
a/drivers/tty/n_gsm.c
b/drivers/tty/n_gsm.c
index 9c5561588174a85661b56e6838fa10c2a1bca026..5a92c51aaf6324b5642c4ca303c109376698e75d 100644
(file)
--- a/
drivers/tty/n_gsm.c
+++ b/
drivers/tty/n_gsm.c
@@
-1977,7
+1977,8
@@
static void gsm1_receive(struct gsm_mux *gsm, unsigned char c)
}
/* Any partial frame was a runt so go back to start */
if (gsm->state != GSM_START) {
- gsm->malformed++;
+ if (gsm->state != GSM_SEARCH)
+ gsm->malformed++;
gsm->state = GSM_START;
}
/* A SOF in GSM_START means we are still reading idling or