From 544e6175330c86ad87abeeb1b048f56bafd96c31 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 12 Dec 2007 18:25:23 -0300 Subject: V4L/DVB (6811): media-video-usbvision-add-mutex_unlock-to-error-paths-fix Signed-off-by: Andrew Morton Signed-off-by: Thierry MERLE Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/usbvision/usbvision-video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index d929ced58ec..92e72910792 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c @@ -1290,8 +1290,8 @@ static int usbvision_radio_open(struct inode *inode, struct file *file) errCode = usbvision_set_alternate(usbvision); if (errCode < 0) { usbvision->last_error = errCode; - mutex_unlock(&usbvision->lock); - return -EBUSY; + errCode = -EBUSY; + goto out; } // If so far no errors then we shall start the radio @@ -1308,6 +1308,7 @@ static int usbvision_radio_open(struct inode *inode, struct file *file) usbvision->initialized = 0; } } +out: mutex_unlock(&usbvision->lock); return errCode; } -- cgit v1.2.3