Commit b62a5166 authored by Hollis Blanchard's avatar Hollis Blanchard Committed by Linus Torvalds

[PATCH] HVSI hangup oops

Testing revealed that the HVSI driver could oops if carrier
detect dropped mid-data transfer.

This fixes it by properly locking the hangup.
Signed-off-by: default avatarHollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4b8ddb73
......@@ -927,11 +927,17 @@ static void hvsi_close(struct tty_struct *tty, struct file *filp)
static void hvsi_hangup(struct tty_struct *tty)
{
struct hvsi_struct *hp = tty->driver_data;
unsigned long flags;
pr_debug("%s\n", __FUNCTION__);
spin_lock_irqsave(&hp->lock, flags);
hp->count = 0;
hp->n_outbuf = 0;
hp->tty = NULL;
spin_unlock_irqrestore(&hp->lock, flags);
}
/* called with hp->lock held */
......
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