From 40e3465db2cffd64e069ca82ee981025554bc159 Mon Sep 17 00:00:00 2001 From: Ken Mills Date: Thu, 4 Nov 2010 15:16:42 +0000 Subject: n_gsm: Fix length handling 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 Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_gsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 7f79044ae99..81b46585edf 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; } } -- cgit v1.2.3-70-g09d2