* [PATCH] tty/n_gsm.c: get gsm->num after gsm_activate_mux
@ 2014-07-23 6:31 xinhui.pan
2014-07-23 13:08 ` One Thousand Gnomes
0 siblings, 1 reply; 2+ messages in thread
From: xinhui.pan @ 2014-07-23 6:31 UTC (permalink / raw)
To: Greg KH, Jiri Slaby; +Cc: linux-kernel, Zhang, Yanmin, mnipxh
gsm->num is the index of gsm_mux[], it's invalid before calling gsm_activate_mux.
Signed-off-by: xinhui.pan <xinhuiX.pan@intel.com>
---
drivers/tty/n_gsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 2ebe47b..81e7ccb 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2230,8 +2230,7 @@ static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len)
static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
{
- int ret, i;
- int base = gsm->num << 6; /* Base for this MUX */
+ int ret, i, base;
gsm->tty = tty_kref_get(tty);
gsm->output = gsmld_output;
@@ -2241,6 +2240,7 @@ static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
else {
/* Don't register device 0 - this is the control channel and not
a usable tty interface */
+ base = gsm->num << 6; /* Base for this MUX */
for (i = 1; i < NUM_DLCI; i++)
tty_register_device(gsm_tty_driver, base + i, NULL);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tty/n_gsm.c: get gsm->num after gsm_activate_mux
2014-07-23 6:31 [PATCH] tty/n_gsm.c: get gsm->num after gsm_activate_mux xinhui.pan
@ 2014-07-23 13:08 ` One Thousand Gnomes
0 siblings, 0 replies; 2+ messages in thread
From: One Thousand Gnomes @ 2014-07-23 13:08 UTC (permalink / raw)
To: xinhui.pan; +Cc: Greg KH, Jiri Slaby, linux-kernel, Zhang, Yanmin, mnipxh
On Wed, 23 Jul 2014 14:31:09 +0800
"xinhui.pan" <xinhuix.pan@intel.com> wrote:
> gsm->num is the index of gsm_mux[], it's invalid before calling gsm_activate_mux.
>
> Signed-off-by: xinhui.pan <xinhuiX.pan@intel.com>
Thanks
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-23 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 6:31 [PATCH] tty/n_gsm.c: get gsm->num after gsm_activate_mux xinhui.pan
2014-07-23 13:08 ` One Thousand Gnomes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).