Patch "tty: n_gsm: fix packet re-transmission without open control channel" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tty: n_gsm: fix packet re-transmission without open control channel

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tty-n_gsm-fix-packet-re-transmission-without-open-co.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1503c79d18b419c40fedd0123f45200b2a5c1bd1
Author: Daniel Starke <daniel.starke@xxxxxxxxxxx>
Date:   Fri Jul 1 08:16:50 2022 +0200

    tty: n_gsm: fix packet re-transmission without open control channel
    
    [ Upstream commit 4fae831b3a71fc5a44cc5c7d0b8c1267ee7659f5 ]
    
    In the current implementation control packets are re-transmitted even if
    the control channel closed down during T2. This is wrong.
    Check whether the control channel is open before re-transmitting any
    packets. Note that control channel open/close is handled by T1 and not T2
    and remains unaffected by this.
    
    Fixes: e1eaea46bb40 ("tty: n_gsm line discipline")
    Signed-off-by: Daniel Starke <daniel.starke@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220701061652.39604-7-daniel.starke@xxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index e7fd4ed08bd5..01ff3f1b2350 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1398,7 +1398,7 @@ static void gsm_control_retransmit(unsigned long data)
 	spin_lock_irqsave(&gsm->control_lock, flags);
 	ctrl = gsm->pending_cmd;
 	if (ctrl) {
-		if (gsm->cretries == 0) {
+		if (gsm->cretries == 0 || !gsm->dlci[0] || gsm->dlci[0]->dead) {
 			gsm->pending_cmd = NULL;
 			ctrl->error = -ETIMEDOUT;
 			ctrl->done = 1;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux