drivers/tty/amiserial.c: add missing tty_unlock
authorJulia Lawall <Julia.Lawall@lip6.fr>
Thu, 19 Apr 2012 16:12:40 +0000 (18:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Apr 2012 16:51:07 +0000 (09:51 -0700)
commit d3a7b83f865b46bb7b5e1ed18a129ce1af349db4 upstream.

tty_unlock is used on all other exits from the function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/amiserial.c

index 220579592c203a47c4441c5562f2f4fece0edd8b..34111486baac0362fc2e1f90e8696cd62c01de8e 100644 (file)
@@ -1113,8 +1113,10 @@ static int set_serial_info(struct async_struct * info,
                    (new_serial.close_delay != state->close_delay) ||
                    (new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
                    ((new_serial.flags & ~ASYNC_USR_MASK) !=
-                    (state->flags & ~ASYNC_USR_MASK)))
+                    (state->flags & ~ASYNC_USR_MASK))) {
+                       tty_unlock();
                        return -EPERM;
+               }
                state->flags = ((state->flags & ~ASYNC_USR_MASK) |
                               (new_serial.flags & ASYNC_USR_MASK));
                info->flags = ((info->flags & ~ASYNC_USR_MASK) |