summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-08-14 02:59:48 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-15 18:52:13 -0300
commitf367cc1efebdfacfca083e55fdeafa0163054995 (patch)
tree52356403f3b27afc635501e37cf06f1770b309cb /drivers/media/usb
parenta7bd775628006f7da1b94d7a5def6746f55f2321 (diff)
[media] stk1160: unlock on error path stk1160_set_alternate()
There are some unlocks missing on error. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/stk1160/stk1160-v4l.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index 360bdbee4270..1ad4ac187727 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -159,8 +159,9 @@ static bool stk1160_set_alternate(struct stk1160 *dev)
static int stk1160_start_streaming(struct stk1160 *dev)
{
- int i, rc;
bool new_pkt_size;
+ int rc = 0;
+ int i;
/* Check device presence */
if (!dev->udev)
@@ -183,7 +184,7 @@ static int stk1160_start_streaming(struct stk1160 *dev)
if (!dev->isoc_ctl.num_bufs || new_pkt_size) {
rc = stk1160_alloc_isoc(dev);
if (rc < 0)
- return rc;
+ goto out_unlock;
}
/* submit urbs and enables IRQ */
@@ -192,7 +193,7 @@ static int stk1160_start_streaming(struct stk1160 *dev)
if (rc) {
stk1160_err("cannot submit urb[%d] (%d)\n", i, rc);
stk1160_uninit_isoc(dev);
- return rc;
+ goto out_unlock;
}
}
@@ -205,9 +206,10 @@ static int stk1160_start_streaming(struct stk1160 *dev)
stk1160_dbg("streaming started\n");
+out_unlock:
mutex_unlock(&dev->v4l_lock);
- return 0;
+ return rc;
}
/* Must be called with v4l_lock hold */