aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 68c26898186..8fd31138f9a 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1330,6 +1330,8 @@ static int video_open(struct inode *inode, struct file *file)
1330 struct saa7134_fh *fh; 1330 struct saa7134_fh *fh;
1331 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1331 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1332 int radio = 0; 1332 int radio = 0;
1333
1334 lock_kernel();
1333 list_for_each_entry(dev, &saa7134_devlist, devlist) { 1335 list_for_each_entry(dev, &saa7134_devlist, devlist) {
1334 if (dev->video_dev && (dev->video_dev->minor == minor)) 1336 if (dev->video_dev && (dev->video_dev->minor == minor))
1335 goto found; 1337 goto found;
@@ -1342,6 +1344,7 @@ static int video_open(struct inode *inode, struct file *file)
1342 goto found; 1344 goto found;
1343 } 1345 }
1344 } 1346 }
1347 unlock_kernel();
1345 return -ENODEV; 1348 return -ENODEV;
1346 found: 1349 found:
1347 1350
@@ -1350,8 +1353,10 @@ static int video_open(struct inode *inode, struct file *file)
1350 1353
1351 /* allocate + initialize per filehandle data */ 1354 /* allocate + initialize per filehandle data */
1352 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 1355 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
1353 if (NULL == fh) 1356 if (NULL == fh) {
1357 unlock_kernel();
1354 return -ENOMEM; 1358 return -ENOMEM;
1359 }
1355 file->private_data = fh; 1360 file->private_data = fh;
1356 fh->dev = dev; 1361 fh->dev = dev;
1357 fh->radio = radio; 1362 fh->radio = radio;
@@ -1384,6 +1389,7 @@ static int video_open(struct inode *inode, struct file *file)
1384 /* switch to video/vbi mode */ 1389 /* switch to video/vbi mode */
1385 video_mux(dev,dev->ctl_input); 1390 video_mux(dev,dev->ctl_input);
1386 } 1391 }
1392 unlock_kernel();
1387 return 0; 1393 return 0;
1388} 1394}
1389 1395