Skip to contentSkip to conversation

synclink: add mutex_unlock() on error path

PATCH New Dan Carpenter 1 participant 1 message Aug 11, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 synclink: add mutex_unlock() on error path

There is a path which still holds its mutex here.

drivers/char/synclink_gt.c +3 -1
index fef80cf..e63b830 100644
@@ -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);