aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-blackbird.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-blackbird.c')
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 9a1374a38ec7..1b7e2e44b802 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1057,12 +1057,15 @@ static int mpeg_open(struct inode *inode, struct file *file)
1057 struct cx8802_driver *drv = NULL; 1057 struct cx8802_driver *drv = NULL;
1058 int err; 1058 int err;
1059 1059
1060 lock_kernel();
1060 dev = cx8802_get_device(inode); 1061 dev = cx8802_get_device(inode);
1061 1062
1062 dprintk( 1, "%s\n", __func__); 1063 dprintk( 1, "%s\n", __func__);
1063 1064
1064 if (dev == NULL) 1065 if (dev == NULL) {
1066 unlock_kernel();
1065 return -ENODEV; 1067 return -ENODEV;
1068 }
1066 1069
1067 /* Make sure we can acquire the hardware */ 1070 /* Make sure we can acquire the hardware */
1068 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD); 1071 drv = cx8802_get_driver(dev, CX88_MPEG_BLACKBIRD);
@@ -1077,6 +1080,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1077 if (blackbird_initialize_codec(dev) < 0) { 1080 if (blackbird_initialize_codec(dev) < 0) {
1078 if (drv) 1081 if (drv)
1079 drv->request_release(drv); 1082 drv->request_release(drv);
1083 unlock_kernel();
1080 return -EINVAL; 1084 return -EINVAL;
1081 } 1085 }
1082 dprintk(1,"open minor=%d\n",minor); 1086 dprintk(1,"open minor=%d\n",minor);
@@ -1086,6 +1090,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1086 if (NULL == fh) { 1090 if (NULL == fh) {
1087 if (drv) 1091 if (drv)
1088 drv->request_release(drv); 1092 drv->request_release(drv);
1093 unlock_kernel();
1089 return -ENOMEM; 1094 return -ENOMEM;
1090 } 1095 }
1091 file->private_data = fh; 1096 file->private_data = fh;
@@ -1101,6 +1106,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1101 /* FIXME: locking against other video device */ 1106 /* FIXME: locking against other video device */
1102 cx88_set_scale(dev->core, dev->width, dev->height, 1107 cx88_set_scale(dev->core, dev->width, dev->height,
1103 fh->mpegq.field); 1108 fh->mpegq.field);
1109 unlock_kernel();
1104 1110
1105 return 0; 1111 return 0;
1106} 1112}