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: xiaojin <jin.xiao@intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int len;
u8 cbuf[10];
u8 ibuf[3];
+ unsigned long flags;
switch (gsm->encoding) {
case 0:
WARN_ON(1);
return;
}
+ spin_lock_irqsave(&gsm->tx_lock, flags);
gsm->output(gsm, cbuf, len);
+ spin_unlock_irqrestore(&gsm->tx_lock, flags);
gsm_print_packet("-->", addr, cr, control, NULL, 0);
}