TTY: hvcs: fix missing unlock on error in hvcs_initialize()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 22 Oct 2012 04:42:59 +0000 (12:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 18:37:02 +0000 (11:37 -0700)
Add the missing unlock on the error handling path in function
hvcs_initialize().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvcs.c

index cab5c7adf8e84314e9ee515465a0db07bb1687e5..744c3b8eea49dbfb141a90bf3a0ad09e2d8f320e 100644 (file)
@@ -1496,8 +1496,10 @@ static int __devinit hvcs_initialize(void)
                num_ttys_to_alloc = hvcs_parm_num_devs;
 
        hvcs_tty_driver = alloc_tty_driver(num_ttys_to_alloc);
-       if (!hvcs_tty_driver)
+       if (!hvcs_tty_driver) {
+               mutex_unlock(&hvcs_init_mutex);
                return -ENOMEM;
+       }
 
        if (hvcs_alloc_index_list(num_ttys_to_alloc)) {
                rc = -ENOMEM;
This page took 0.042646 seconds and 5 git commands to generate.