Staging: generic_serial: fix double locking bug
authorDan Carpenter <error27@gmail.com>
Mon, 28 Feb 2011 19:28:31 +0000 (22:28 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 28 Feb 2011 21:21:20 +0000 (13:21 -0800)
spin_lock_irqsave() is not nestable.  The second time that it gets
called it overwrites the "flags" variable and so IRQs can't be restored
properly.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/generic_serial/generic_serial.c

index 5954ee1dc9538c4eb4849f07c1d28e06558782a3..466988dbc37d116f08a537f1263238f9a38cdf6d 100644 (file)
@@ -566,9 +566,9 @@ void gs_close(struct tty_struct * tty, struct file * filp)
         * line status register.
         */
 
-       spin_lock_irqsave(&port->driver_lock, flags);
+       spin_lock(&port->driver_lock);
        port->rd->disable_rx_interrupts (port);
-       spin_unlock_irqrestore(&port->driver_lock, flags);
+       spin_unlock(&port->driver_lock);
        spin_unlock_irqrestore(&port->port.lock, flags);
 
        /* close has no way of returning "EINTR", so discard return value */