n_gsm: fix the wrong FCS handling
authorDu, Alek <alek.du@intel.com>
Thu, 7 Jul 2011 14:16:48 +0000 (15:16 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Aug 2011 04:58:40 +0000 (21:58 -0700)
commit f086ced17191fa0c5712539d2b680eae3dc972a1 upstream.

FCS could be GSM0_SOF, so will break state machine...

[This byte isn't quoted in any way so a SOF here doesn't imply an error
 occurred.]

Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
[Trivial but best backported once its in 3.1rc I think]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/n_gsm.c

index 19b4ae0..c0d34ad 100644 (file)
@@ -1823,10 +1823,6 @@ static void gsm0_receive(struct gsm_mux *gsm, unsigned char c)
                break;
        case GSM_FCS:           /* FCS follows the packet */
                gsm->received_fcs = c;
-               if (c == GSM0_SOF) {
-                       gsm->state = GSM_SEARCH;
-                       break;
-               }
                gsm_queue(gsm);
                gsm->state = GSM_SSOF;
                break;