From: Ken Mills Date: Thu, 4 Nov 2010 15:16:42 +0000 (+0000) Subject: n_gsm: Fix length handling X-Git-Tag: MMI-PSA29.97-13-9~21770^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40e3465db2cffd64e069ca82ee981025554bc159;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 7f79044ae996..81b46585edf7 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; } }