[PATCH 19/19] n_gsm: Fix length handling

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg Kroah-Hartman
Date: Friday, November 12, 2010 - 2:41 pm

From: Ken Mills <ken.k.mills@intel.com>

If the mux is configured with a large mru/mtu the existing code gets the
byte ordering wrong for the header.

Signed-off-by: Ken Mills <ken.k.mills@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/n_gsm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 7f79044..81b4658 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -716,8 +716,8 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg)
 		if (msg->len < 128)
 			*--dp = (msg->len << 1) | EA;
 		else {
-			*--dp = (msg->len >> 6) | EA;
-			*--dp = (msg->len & 127) << 1;
+			*--dp = ((msg->len & 127) << 1) | EA;
+			*--dp = (msg->len >> 6) & 0xfe;
 		}
 	}
 
-- 
1.7.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] TTY/serial fixes for .37-rc1, Greg KH, (Fri Nov 12, 2:32 pm)
[PATCH 01/19] tty: the development tree is now done in git, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 02/19] tty: Fix formatting in tty.h, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 03/19] tty: fix warning in synclink driver, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 04/19] nozomi: Fix warning from the previous TIOCGC ..., Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 05/19] 8250: add support for Kouwell KW-L221N-2, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 06/19] tty: prevent DOS in the flush_to_ldisc, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 07/19] drivers/serial/bfin_5xx.c: Fix line continua ..., Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 08/19] SERIAL: blacklist si3052 chip, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 10/19] tty_ldisc: Fix BUG() on hangup, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 11/19] 8250: Fix tcsetattr to avoid ioctl(TIOCMIWAI ..., Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 12/19] amiserial: Remove unused variable icount, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 13/19] vcs: make proper usage of the poll flags, Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 14/19] serial: bfin_5xx: always include DMA headers, Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 15/19] serial: bfin_5xx: remove redundant SSYNC to ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 16/19] serial: bfin_5xx: disable CON_PRINTBUFFER fo ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 17/19] serial: bfin_5xx: grab port lock before maki ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 18/19] n_gsm: Copy n2 over when configuring via ioc ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 19/19] n_gsm: Fix length handling, Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
Re: [PATCH 10/19] tty_ldisc: Fix BUG() on hangup, Russ Dill, (Tue Dec 7, 2:00 pm)