Comment 28 for bug 1165433

Revision history for this message
eccerr0r (blc+launchpad) wrote : Re: Kernel 3.8.x panics on bluetooth DUN disconnect

This workaround, though the original submitter doesn't think it does much, seems to at least prevent my machine from crashing...

     diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
    index 6d9e0b2..a4f4fa9 100644
    --- a/drivers/tty/tty_port.c
    +++ b/drivers/tty/tty_port.c
    @@ -140,6 +140,10 @@ EXPORT_SYMBOL(tty_port_destroy);
    static void tty_port_destructor(struct kref *kref)
    {
    struct tty_port *port = container_of(kref, struct tty_port, kref);
    +
    + /* check if last port ref was dropped before tty release */
    + if (WARN_ON(port->itty))
    + return;
    if (port->xmit_buf)
    free_page((unsigned long)port->xmit_buf);
    tty_port_destroy(port);

So far the machine still oopses but no hang at least, bluetooth is completely hosed but it was already hosed anyway...