[PATCH 5/6] synclink: add mutex_unlock() on error path

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg Kroah-Hartman
Date: Monday, August 23, 2010 - 9:24 pm

From: Dan Carpenter <error27@gmail.com>

There is a path which still holds its mutex here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/char/synclink_gt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index fef80cf..e63b830 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -691,8 +691,10 @@ static int open(struct tty_struct *tty, struct file *filp)
 	if (info->port.count == 1) {
 		/* 1st open on this device, init hardware */
 		retval = startup(info);
-		if (retval < 0)
+		if (retval < 0) {
+			mutex_unlock(&info->port.mutex);
 			goto cleanup;
+		}
 	}
 	mutex_unlock(&info->port.mutex);
 	retval = block_til_ready(tty, filp, info);
-- 
1.7.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] TTY fixes for .36-rc2, Greg KH, (Mon Aug 23, 9:05 pm)
[PATCH 1/6] serial: print early console device address in hex, Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 2/6] ip2: remove unneeded NULL check, Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 3/6] ip2: return -EFAULT on copy_to_user errors, Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 4/6] rocket: add a mutex_unlock(), Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 5/6] synclink: add mutex_unlock() on error path, Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)
[PATCH 6/6] 68328serial: check return value of copy_*_user ..., Greg Kroah-Hartman, (Mon Aug 23, 9:24 pm)