Skip to content

Commit a24b4b2

Browse files
dstarke-siemensgregkh
authored andcommitted
tty: n_gsm: fix malformed counter for out of frame data
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: e1eaea4 ("tty: n_gsm line discipline") Cc: [email protected] Signed-off-by: Daniel Starke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7a0e4b1 commit a24b4b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/tty/n_gsm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,8 @@ static void gsm1_receive(struct gsm_mux *gsm, unsigned char c)
20442044
}
20452045
/* Any partial frame was a runt so go back to start */
20462046
if (gsm->state != GSM_START) {
2047-
gsm->malformed++;
2047+
if (gsm->state != GSM_SEARCH)
2048+
gsm->malformed++;
20482049
gsm->state = GSM_START;
20492050
}
20502051
/* A SOF in GSM_START means we are still reading idling or

0 commit comments

Comments
 (0)