Commit f96f7f7f authored by xiaojin's avatar xiaojin Committed by Greg Kroah-Hartman

n_gsm.c: add tx_lock in gsm_send

All the call to gsm->output should be in the tx_lock,
that could avoid potential race from MUX level. But
we have no tx_lock in gsm_send.

This patch is to add tx_lock in gsm_send.
Signed-off-by: default avatarxiaojin <jin.xiao@intel.com>
Acked-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5425e03f
...@@ -573,6 +573,7 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control) ...@@ -573,6 +573,7 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control)
int len; int len;
u8 cbuf[10]; u8 cbuf[10];
u8 ibuf[3]; u8 ibuf[3];
unsigned long flags;
switch (gsm->encoding) { switch (gsm->encoding) {
case 0: case 0:
...@@ -602,7 +603,9 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control) ...@@ -602,7 +603,9 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control)
WARN_ON(1); WARN_ON(1);
return; return;
} }
spin_lock_irqsave(&gsm->tx_lock, flags);
gsm->output(gsm, cbuf, len); gsm->output(gsm, cbuf, len);
spin_unlock_irqrestore(&gsm->tx_lock, flags);
gsm_print_packet("-->", addr, cr, control, NULL, 0); gsm_print_packet("-->", addr, cr, control, NULL, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment