summaryrefslogtreecommitdiff
path: root/drivers/char/moxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/moxa.c')
-rw-r--r--drivers/char/moxa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 1ab9517c24c5..585fac179ec6 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -1280,6 +1280,7 @@ static int moxa_chars_in_buffer(struct tty_struct *tty)
*/
if (ch == NULL)
return 0;
+ lock_kernel();
chars = MoxaPortTxQueue(ch);
if (chars) {
/*
@@ -1289,6 +1290,7 @@ static int moxa_chars_in_buffer(struct tty_struct *tty)
if (!(ch->statusflags & EMPTYWAIT))
moxa_setup_empty_event(tty);
}
+ unlock_kernel();
return chars;
}