]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/tty/hvc/hvc_console.c
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / tty / hvc / hvc_console.c
index b19ae36a05ec753c4edade42ff1f55c036a28c8a..a8d399188242efe428bb579f845b716396465d9f 100644 (file)
@@ -920,17 +920,17 @@ int hvc_remove(struct hvc_struct *hp)
 
        tty = tty_port_tty_get(&hp->port);
 
+       console_lock();
        spin_lock_irqsave(&hp->lock, flags);
        if (hp->index < MAX_NR_HVC_CONSOLES) {
-               console_lock();
                vtermnos[hp->index] = -1;
                cons_ops[hp->index] = NULL;
-               console_unlock();
        }
 
        /* Don't whack hp->irq because tty_hangup() will need to free the irq. */
 
        spin_unlock_irqrestore(&hp->lock, flags);
+       console_unlock();
 
        /*
         * We 'put' the instance that was grabbed when the kref instance