aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cafe_ccic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cafe_ccic.c')
-rw-r--r--drivers/media/video/cafe_ccic.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 08efbe7254ff..fc9497bdd322 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -1476,9 +1476,12 @@ static int cafe_v4l_open(struct inode *inode, struct file *filp)
1476{ 1476{
1477 struct cafe_camera *cam; 1477 struct cafe_camera *cam;
1478 1478
1479 lock_kernel();
1479 cam = cafe_find_dev(iminor(inode)); 1480 cam = cafe_find_dev(iminor(inode));
1480 if (cam == NULL) 1481 if (cam == NULL) {
1482 unlock_kernel();
1481 return -ENODEV; 1483 return -ENODEV;
1484 }
1482 filp->private_data = cam; 1485 filp->private_data = cam;
1483 1486
1484 mutex_lock(&cam->s_mutex); 1487 mutex_lock(&cam->s_mutex);
@@ -1490,6 +1493,7 @@ static int cafe_v4l_open(struct inode *inode, struct file *filp)
1490 } 1493 }
1491 (cam->users)++; 1494 (cam->users)++;
1492 mutex_unlock(&cam->s_mutex); 1495 mutex_unlock(&cam->s_mutex);
1496 unlock_kernel();
1493 return 0; 1497 return 0;
1494} 1498}
1495 1499