Skip to content

Commit deefc58

Browse files
dstarke-siemensgregkh
authored andcommitted
tty: n_gsm: fix wrong DLCI release order
The current DLCI release order starts with the control channel followed by the user channels. Reverse this order to keep the control channel open until all user channels have been released. 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 535bf60 commit deefc58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/n_gsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,8 +2146,8 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
21462146
/* Finish outstanding timers, making sure they are done */
21472147
del_timer_sync(&gsm->t2_timer);
21482148

2149-
/* Free up any link layer users */
2150-
for (i = 0; i < NUM_DLCI; i++)
2149+
/* Free up any link layer users and finally the control channel */
2150+
for (i = NUM_DLCI - 1; i >= 0; i--)
21512151
if (gsm->dlci[i])
21522152
gsm_dlci_release(gsm->dlci[i]);
21532153
mutex_unlock(&gsm->mutex);

0 commit comments

Comments
 (0)