[PATCH -mm] media: video: usbvision: add mutex_unlock() to error paths

From: Daniel Walker
Date: Tue Dec 11 2007 - 21:08:46 EST


There are a few error paths which don't unlock the usbvision->lock.

So I've added mutex_unlock() calls to fix those paths.

Signed-off-by: Daniel Walker <dwalker@xxxxxxxxxx>

---
drivers/media/video/usbvision/usbvision-video.c | 2 ++
1 file changed, 2 insertions(+)

Index: linux-2.6.23/drivers/media/video/usbvision/usbvision-video.c
===================================================================
--- linux-2.6.23.orig/drivers/media/video/usbvision/usbvision-video.c
+++ linux-2.6.23/drivers/media/video/usbvision/usbvision-video.c
@@ -1290,6 +1290,7 @@ static int usbvision_radio_open(struct i
errCode = usbvision_set_alternate(usbvision);
if (errCode < 0) {
usbvision->last_error = errCode;
+ mutex_unlock(&usbvision->lock);
return -EBUSY;
}

@@ -1806,6 +1807,7 @@ static int __devinit usbvision_probe(str
usbvision->num_alt,GFP_KERNEL);
if (usbvision->alt_max_pkt_size == NULL) {
err("usbvision: out of memory!\n");
+ mutex_unlock(&usbvision->lock);
return -ENOMEM;
}

--

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/