Re: Fixing the holes in the tty layer

From: David S. Miller
Date: Thu Sep 09 2004 - 12:01:48 EST


On Thu, 9 Sep 2004 12:22:22 -0400
Alan Cox <alan@xxxxxxxxxx> wrote:

> +void tty_ldisc_put(int disc)

That takes tty_ldisc_lock.

> static int tty_set_ldisc(struct tty_struct *tty, int ldisc)
...
> + spin_lock_irqsave(&tty_ldisc_lock, flags);
> + if(tty->ldisc.refcount)
> + {
> + /* Free the new ldisc we grabbed */
> + tty_ldisc_put(ldisc);
> + spin_unlock_irqrestore(&tty_ldisc_lock, flags);
> + return -EBUSY;
> + }

Therefore this call her deadlocks since we already hold
the lock.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/