From: Dan Carpenter Date: Wed, 11 Aug 2010 18:01:46 +0000 (+0200) Subject: synclink: add mutex_unlock() on error path X-Git-Tag: Ubuntu-5.10.0-12.13~27160^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=80d04f22b0869a1145b36a90a83a79603ac92be8;p=mirror_ubuntu-hirsute-kernel.git synclink: add mutex_unlock() on error path There is a path which still holds its mutex here. Signed-off-by: Dan Carpenter Acked-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index fef80cfcab5c..e63b830c86cc 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);