mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
net/irda: Hold port lock while bumping blocked_open
Although tty_lock() already protects concurrent update to blocked_open, that fails to meet the separation-of-concerns between tty_port and tty. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a4ed2e737c
commit
2f7c069b96
1 changed files with 2 additions and 2 deletions
|
@ -317,8 +317,8 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
spin_lock_irqsave(&port->lock, flags);
|
||||||
if (!tty_hung_up_p(filp))
|
if (!tty_hung_up_p(filp))
|
||||||
port->count--;
|
port->count--;
|
||||||
spin_unlock_irqrestore(&port->lock, flags);
|
|
||||||
port->blocked_open++;
|
port->blocked_open++;
|
||||||
|
spin_unlock_irqrestore(&port->lock, flags);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (tty->termios.c_cflag & CBAUD)
|
if (tty->termios.c_cflag & CBAUD)
|
||||||
|
@ -362,8 +362,8 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
spin_lock_irqsave(&port->lock, flags);
|
||||||
if (!tty_hung_up_p(filp))
|
if (!tty_hung_up_p(filp))
|
||||||
port->count++;
|
port->count++;
|
||||||
spin_unlock_irqrestore(&port->lock, flags);
|
|
||||||
port->blocked_open--;
|
port->blocked_open--;
|
||||||
|
spin_unlock_irqrestore(&port->lock, flags);
|
||||||
|
|
||||||
IRDA_DEBUG(1, "%s(%d):block_til_ready after blocking on %s open_count=%d\n",
|
IRDA_DEBUG(1, "%s(%d):block_til_ready after blocking on %s open_count=%d\n",
|
||||||
__FILE__, __LINE__, tty->driver->name, port->count);
|
__FILE__, __LINE__, tty->driver->name, port->count);
|
||||||
|
|
Loading…
Reference in a new issue