diff options
author | Alexander Strakh <strakh@ispras.ru> | 2009-09-11 14:13:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:51 -0500 |
commit | 0faf6f6b892aeb25934c9adc7fe328350d2d25cc (patch) | |
tree | d2ad76bed8be53b5c692365561de50317cc1e4fa | |
parent | fb3ab105a5ef43b03d2788e9b124c7c69112682f (diff) |
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>
-rw-r--r-- | drivers/media/video/cafe_ccic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 7bb9c1ec781..cbbf7e80d2c 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, | |||
1907 | goto out_free; | 1907 | goto out_free; |
1908 | 1908 | ||
1909 | mutex_init(&cam->s_mutex); | 1909 | mutex_init(&cam->s_mutex); |
1910 | mutex_lock(&cam->s_mutex); | ||
1911 | spin_lock_init(&cam->dev_lock); | 1910 | spin_lock_init(&cam->dev_lock); |
1912 | cam->state = S_NOTREADY; | 1911 | cam->state = S_NOTREADY; |
1913 | cafe_set_config_needed(cam, 1); | 1912 | cafe_set_config_needed(cam, 1); |
@@ -1947,7 +1946,6 @@ static int cafe_pci_probe(struct pci_dev *pdev, | |||
1947 | * because the sensor could attach in this call chain, leading to | 1946 | * because the sensor could attach in this call chain, leading to |
1948 | * unsightly deadlocks. | 1947 | * unsightly deadlocks. |
1949 | */ | 1948 | */ |
1950 | mutex_unlock(&cam->s_mutex); /* attach can deadlock */ | ||
1951 | ret = cafe_smbus_setup(cam); | 1949 | ret = cafe_smbus_setup(cam); |
1952 | if (ret) | 1950 | if (ret) |
1953 | goto out_freeirq; | 1951 | goto out_freeirq; |
@@ -1973,7 +1971,7 @@ static int cafe_pci_probe(struct pci_dev *pdev, | |||
1973 | cam->vdev.v4l2_dev = &cam->v4l2_dev; | 1971 | cam->vdev.v4l2_dev = &cam->v4l2_dev; |
1974 | ret = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1); | 1972 | ret = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1); |
1975 | if (ret) | 1973 | if (ret) |
1976 | goto out_smbus; | 1974 | goto out_unlock; |
1977 | video_set_drvdata(&cam->vdev, cam); | 1975 | video_set_drvdata(&cam->vdev, cam); |
1978 | 1976 | ||
1979 | /* | 1977 | /* |
@@ -1988,6 +1986,8 @@ static int cafe_pci_probe(struct pci_dev *pdev, | |||
1988 | mutex_unlock(&cam->s_mutex); | 1986 | mutex_unlock(&cam->s_mutex); |
1989 | return 0; | 1987 | return 0; |
1990 | 1988 | ||
1989 | out_unlock: | ||
1990 | mutex_unlock(&cam->s_mutex); | ||
1991 | out_smbus: | 1991 | out_smbus: |
1992 | cafe_smbus_shutdown(cam); | 1992 | cafe_smbus_shutdown(cam); |
1993 | out_freeirq: | 1993 | out_freeirq: |