All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: torvalds@linux-foundation.org, linux-serial@vger.kernel.org
Subject: [PATCH 2/4] n_gsm: Fix length handling
Date: Thu, 04 Nov 2010 15:16:42 +0000	[thread overview]
Message-ID: <20101104151636.21790.59330.stgit@localhost.localdomain> (raw)
In-Reply-To: <20101104151623.21790.64456.stgit@localhost.localdomain>

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>
---

 drivers/char/n_gsm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/char/n_gsm.c b/drivers/char/n_gsm.c
index 7f79044..81b4658 100644
--- a/drivers/char/n_gsm.c
+++ b/drivers/char/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;
 		}
 	}
 


  reply	other threads:[~2010-11-04 15:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 15:16 [PATCH 1/4] n_gsm: Copy n2 over when configuring via ioctl interface Alan Cox
2010-11-04 15:16 ` Alan Cox [this message]
2010-11-04 16:05   ` [PATCH 2/4] n_gsm: Fix length handling Greg KH
2010-11-04 15:17 ` [PATCH 3/4] n_gsm: Fix support for legacy encoding Alan Cox
2010-11-04 16:04   ` Greg KH
2010-11-04 15:17 ` [PATCH 4/4] n_gsm: clean up printks Alan Cox
2010-11-04 16:04   ` Greg KH
2010-11-04 16:04 ` [PATCH 1/4] n_gsm: Copy n2 over when configuring via ioctl interface Greg KH
2010-11-04 16:08   ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101104151636.21790.59330.stgit@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-serial@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.