aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_port.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index dd471d63fae2..3ef644a2e517 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -25,6 +25,7 @@ void tty_port_init(struct tty_port *port)
25 init_waitqueue_head(&port->close_wait); 25 init_waitqueue_head(&port->close_wait);
26 init_waitqueue_head(&port->delta_msr_wait); 26 init_waitqueue_head(&port->delta_msr_wait);
27 mutex_init(&port->mutex); 27 mutex_init(&port->mutex);
28 mutex_init(&port->buf_mutex);
28 spin_lock_init(&port->lock); 29 spin_lock_init(&port->lock);
29 port->close_delay = (50 * HZ) / 100; 30 port->close_delay = (50 * HZ) / 100;
30 port->closing_wait = (3000 * HZ) / 100; 31 port->closing_wait = (3000 * HZ) / 100;
@@ -34,10 +35,10 @@ EXPORT_SYMBOL(tty_port_init);
34int tty_port_alloc_xmit_buf(struct tty_port *port) 35int tty_port_alloc_xmit_buf(struct tty_port *port)
35{ 36{
36 /* We may sleep in get_zeroed_page() */ 37 /* We may sleep in get_zeroed_page() */
37 mutex_lock(&port->mutex); 38 mutex_lock(&port->buf_mutex);
38 if (port->xmit_buf == NULL) 39 if (port->xmit_buf == NULL)
39 port->xmit_buf = (unsigned char *)get_zeroed_page(GFP_KERNEL); 40 port->xmit_buf = (unsigned char *)get_zeroed_page(GFP_KERNEL);
40 mutex_unlock(&port->mutex); 41 mutex_unlock(&port->buf_mutex);
41 if (port->xmit_buf == NULL) 42 if (port->xmit_buf == NULL)
42 return -ENOMEM; 43 return -ENOMEM;
43 return 0; 44 return 0;
@@ -46,12 +47,12 @@ EXPORT_SYMBOL(tty_port_alloc_xmit_buf);
46 47
47void tty_port_free_xmit_buf(struct tty_port *port) 48void tty_port_free_xmit_buf(struct tty_port *port)
48{ 49{
49 mutex_lock(&port->mutex); 50 mutex_lock(&port->buf_mutex);
50 if (port->xmit_buf != NULL) { 51 if (port->xmit_buf != NULL) {
51 free_page((unsigned long)port->xmit_buf); 52 free_page((unsigned long)port->xmit_buf);
52 port->xmit_buf = NULL; 53 port->xmit_buf = NULL;
53 } 54 }
54 mutex_unlock(&port->mutex); 55 mutex_unlock(&port->buf_mutex);
55} 56}
56EXPORT_SYMBOL(tty_port_free_xmit_buf); 57EXPORT_SYMBOL(tty_port_free_xmit_buf);
57 58