aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-417.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-417.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index 7b0e8c01692e..93777d06d0ac 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -1583,6 +1583,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1583 1583
1584 dprintk(2, "%s()\n", __func__); 1584 dprintk(2, "%s()\n", __func__);
1585 1585
1586 lock_kernel();
1586 list_for_each(list, &cx23885_devlist) { 1587 list_for_each(list, &cx23885_devlist) {
1587 h = list_entry(list, struct cx23885_dev, devlist); 1588 h = list_entry(list, struct cx23885_dev, devlist);
1588 if (h->v4l_device->minor == minor) { 1589 if (h->v4l_device->minor == minor) {
@@ -1591,13 +1592,17 @@ static int mpeg_open(struct inode *inode, struct file *file)
1591 } 1592 }
1592 } 1593 }
1593 1594
1594 if (dev == NULL) 1595 if (dev == NULL) {
1596 unlock_kernel();
1595 return -ENODEV; 1597 return -ENODEV;
1598 }
1596 1599
1597 /* allocate + initialize per filehandle data */ 1600 /* allocate + initialize per filehandle data */
1598 fh = kzalloc(sizeof(*fh), GFP_KERNEL); 1601 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
1599 if (NULL == fh) 1602 if (NULL == fh) {
1603 unlock_kernel();
1600 return -ENOMEM; 1604 return -ENOMEM;
1605 }
1601 1606
1602 file->private_data = fh; 1607 file->private_data = fh;
1603 fh->dev = dev; 1608 fh->dev = dev;
@@ -1608,6 +1613,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1608 V4L2_FIELD_INTERLACED, 1613 V4L2_FIELD_INTERLACED,
1609 sizeof(struct cx23885_buffer), 1614 sizeof(struct cx23885_buffer),
1610 fh); 1615 fh);
1616 unlock_kernel();
1611 1617
1612 return 0; 1618 return 0;
1613} 1619}