]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: dgnc: release the lock before testing for nullity
authorQuentin Lambert <lambert.quentin@gmail.com>
Wed, 18 Mar 2015 13:21:08 +0000 (14:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 16:34:11 +0000 (17:34 +0100)
The refactoring intrduced in
c84a083b995b ("Staging: dgnc: Use goto for spinlock release before return")
inverts the order in which the lock is released and ld is tested for nullity.

This patch restores the execution flow.

Fixes: c84a083b995b ("Staging: dgnc: Use goto for spinlock release before return")
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c

index 8445f84ddaa35b982dd48ab383f9ab4040281a5c..f1c4d07a0aaa578bbd1ca900c0b9316045900b27 100644 (file)
@@ -656,9 +656,9 @@ void dgnc_input(struct channel_t *ch)
        return;
 
 exit_unlock:
+       spin_unlock_irqrestore(&ch->ch_lock, flags);
        if (ld)
                tty_ldisc_deref(ld);
-       spin_unlock_irqrestore(&ch->ch_lock, flags);
 }