Skip to content

Commit

Permalink
V4L/DVB: cafe_ccic: Fix lock imbalances
Browse files Browse the repository at this point in the history
Fix lock imbalances in function device_authorization.

Signed-off-by: Alexander Strakh <strakh@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Alexander Strakh authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent fb3ab10 commit 0faf6f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/video/cafe_ccic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);

/*
Expand All @@ -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:
Expand Down

0 comments on commit 0faf6f6

Please sign in to comment.