aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-video.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 6047c78d84bf..d9bef1a54d1f 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -731,6 +731,7 @@ static int video_open(struct inode *inode, struct file *file)
731 enum v4l2_buf_type type = 0; 731 enum v4l2_buf_type type = 0;
732 int radio = 0; 732 int radio = 0;
733 733
734 lock_kernel();
734 list_for_each(list, &cx23885_devlist) { 735 list_for_each(list, &cx23885_devlist) {
735 h = list_entry(list, struct cx23885_dev, devlist); 736 h = list_entry(list, struct cx23885_dev, devlist);
736 if (h->video_dev->minor == minor) { 737 if (h->video_dev->minor == minor) {
@@ -748,16 +749,20 @@ static int video_open(struct inode *inode, struct file *file)
748 dev = h; 749 dev = h;
749 } 750 }
750 } 751 }
751 if (NULL == dev) 752 if (NULL == dev) {
753 unlock_kernel();
752 return -ENODEV; 754 return -ENODEV;
755 }
753 756
754 dprintk(1, "open minor=%d radio=%d type=%s\n", 757 dprintk(1, "open minor=%d radio=%d type=%s\n",
755 minor, radio, v4l2_type_names[type]); 758 minor, radio, v4l2_type_names[type]);
756 759
757 /* allocate + initialize per filehandle data */ 760 /* allocate + initialize per filehandle data */
758 fh = kzalloc(sizeof(*fh), GFP_KERNEL); 761 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
759 if (NULL == fh) 762 if (NULL == fh) {
763 unlock_kernel();
760 return -ENOMEM; 764 return -ENOMEM;
765 }
761 file->private_data = fh; 766 file->private_data = fh;
762 fh->dev = dev; 767 fh->dev = dev;
763 fh->radio = radio; 768 fh->radio = radio;
@@ -775,6 +780,7 @@ static int video_open(struct inode *inode, struct file *file)
775 780
776 dprintk(1, "post videobuf_queue_init()\n"); 781 dprintk(1, "post videobuf_queue_init()\n");
777 782
783 unlock_kernel();
778 784
779 return 0; 785 return 0;
780} 786}