aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 49ab0629702e..600b340e3550 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1512,6 +1512,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1512 struct em28xx_fh *fh; 1512 struct em28xx_fh *fh;
1513 enum v4l2_buf_type fh_type = 0; 1513 enum v4l2_buf_type fh_type = 0;
1514 1514
1515 lock_kernel();
1515 list_for_each_entry(h, &em28xx_devlist, devlist) { 1516 list_for_each_entry(h, &em28xx_devlist, devlist) {
1516 if (h->vdev->minor == minor) { 1517 if (h->vdev->minor == minor) {
1517 dev = h; 1518 dev = h;
@@ -1527,8 +1528,10 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1527 dev = h; 1528 dev = h;
1528 } 1529 }
1529 } 1530 }
1530 if (NULL == dev) 1531 if (NULL == dev) {
1532 unlock_kernel();
1531 return -ENODEV; 1533 return -ENODEV;
1534 }
1532 1535
1533 em28xx_videodbg("open minor=%d type=%s users=%d\n", 1536 em28xx_videodbg("open minor=%d type=%s users=%d\n",
1534 minor, v4l2_type_names[fh_type], dev->users); 1537 minor, v4l2_type_names[fh_type], dev->users);
@@ -1537,6 +1540,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1537 fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); 1540 fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL);
1538 if (!fh) { 1541 if (!fh) {
1539 em28xx_errdev("em28xx-video.c: Out of memory?!\n"); 1542 em28xx_errdev("em28xx-video.c: Out of memory?!\n");
1543 unlock_kernel();
1540 return -ENOMEM; 1544 return -ENOMEM;
1541 } 1545 }
1542 mutex_lock(&dev->lock); 1546 mutex_lock(&dev->lock);
@@ -1573,6 +1577,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1573 sizeof(struct em28xx_buffer), fh); 1577 sizeof(struct em28xx_buffer), fh);
1574 1578
1575 mutex_unlock(&dev->lock); 1579 mutex_unlock(&dev->lock);
1580 unlock_kernel();
1576 1581
1577 return errCode; 1582 return errCode;
1578} 1583}