From: Dan Carpenter Date: Wed, 11 Aug 2010 18:01:46 +0000 (+0200) Subject: synclink: add mutex_unlock() on error path X-Git-Tag: v2.6.36-rc3~39^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80d04f22b0869a1145b36a90a83a79603ac92be8;p=profile%2Fcommon%2Fkernel-common.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 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);