summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cafe_ccic.c
diff options
context:
space:
mode:
authorAlexander Strakh <strakh@ispras.ru>2009-09-11 20:13:21 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 19:10:51 +0100
commit0faf6f6b892aeb25934c9adc7fe328350d2d25cc (patch)
treed2ad76bed8be53b5c692365561de50317cc1e4fa /drivers/media/video/cafe_ccic.c
parentV4L/DVB: stv0900: dereference of state->internal in fe_stv0900_error stv0900_... (diff)
downloadlinux-0faf6f6b892aeb25934c9adc7fe328350d2d25cc.tar.xz
linux-0faf6f6b892aeb25934c9adc7fe328350d2d25cc.zip
V4L/DVB: cafe_ccic: Fix lock imbalances
Fix lock imbalances in function device_authorization. Signed-off-by: Alexander Strakh <strakh@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cafe_ccic.c')
-rw-r--r--drivers/media/video/cafe_ccic.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 7bb9c1ec7819..cbbf7e80d2cf 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -1907,7 +1907,6 @@ static int cafe_pci_probe(struct pci_dev *pdev,
goto out_free;
mutex_init(&cam->s_mutex);
- mutex_lock(&cam->s_mutex);
spin_lock_init(&cam->dev_lock);
cam->state = S_NOTREADY;
cafe_set_config_needed(cam, 1);
@@ -1947,7 +1946,6 @@ static int cafe_pci_probe(struct pci_dev *pdev,
* because the sensor could attach in this call chain, leading to
* unsightly deadlocks.
*/
- mutex_unlock(&cam->s_mutex); /* attach can deadlock */
ret = cafe_smbus_setup(cam);
if (ret)
goto out_freeirq;
@@ -1973,7 +1971,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
cam->vdev.v4l2_dev = &cam->v4l2_dev;
ret = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1);
if (ret)
- goto out_smbus;
+ goto out_unlock;
video_set_drvdata(&cam->vdev, cam);
/*
@@ -1988,6 +1986,8 @@ static int cafe_pci_probe(struct pci_dev *pdev,
mutex_unlock(&cam->s_mutex);
return 0;
+out_unlock:
+ mutex_unlock(&cam->s_mutex);
out_smbus:
cafe_smbus_shutdown(cam);
out_freeirq: