Showing error 599

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: drivers/char/generic_serial.c
Line in file: 583
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 510a3049573868d3d77414bfa55d293f44d0dbbe
Tools: Stanse (1.2)
Smatch (1.59)
Entered: 2011-11-07 22:20:57 UTC


Source:

553           tty_wait_until_sent(tty, port->closing_wait); */
554
555        /*
556         * At this point we stop accepting input.  To do this, we
557         * disable the receive line status interrupts, and tell the
558         * interrupt driver to stop checking the data ready bit in the
559         * line status register.
560         */
561
562        port->rd->disable_rx_interrupts (port);
563        spin_unlock_irqrestore(&port->driver_lock, flags);
564
565        /* close has no way of returning "EINTR", so discard return value */
566        if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
567                gs_wait_tx_flushed (port, port->closing_wait);
568
569        port->port.flags &= ~GS_ACTIVE;
570
571        gs_flush_buffer(tty);
572
573        tty_ldisc_flush(tty);
574        tty->closing = 0;
575
576        port->event = 0;
577        port->rd->close (port);
578        port->rd->shutdown_port (port);
579        port->port.tty = NULL;
580
581        if (port->port.blocked_open) {
582                if (port->close_delay) {
583                        spin_unlock_irqrestore(&port->driver_lock, flags);
584                        msleep_interruptible(jiffies_to_msecs(port->close_delay));
585                        spin_lock_irqsave(&port->driver_lock, flags);
586                }
587                wake_up_interruptible(&port->port.open_wait);
588        }
589        port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING | ASYNC_INITIALIZED);
590        wake_up_interruptible(&port->port.close_wait);
591
592        func_exit ();
593}
Show full sources