aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 933eaef41ead..c3526d0258f8 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3227,6 +3227,7 @@ static int bttv_open(struct inode *inode, struct file *file)
3227 3227
3228 dprintk(KERN_DEBUG "bttv: open minor=%d\n",minor); 3228 dprintk(KERN_DEBUG "bttv: open minor=%d\n",minor);
3229 3229
3230 lock_kernel();
3230 for (i = 0; i < bttv_num; i++) { 3231 for (i = 0; i < bttv_num; i++) {
3231 if (bttvs[i].video_dev && 3232 if (bttvs[i].video_dev &&
3232 bttvs[i].video_dev->minor == minor) { 3233 bttvs[i].video_dev->minor == minor) {
@@ -3241,16 +3242,20 @@ static int bttv_open(struct inode *inode, struct file *file)
3241 break; 3242 break;
3242 } 3243 }
3243 } 3244 }
3244 if (NULL == btv) 3245 if (NULL == btv) {
3246 unlock_kernel();
3245 return -ENODEV; 3247 return -ENODEV;
3248 }
3246 3249
3247 dprintk(KERN_DEBUG "bttv%d: open called (type=%s)\n", 3250 dprintk(KERN_DEBUG "bttv%d: open called (type=%s)\n",
3248 btv->c.nr,v4l2_type_names[type]); 3251 btv->c.nr,v4l2_type_names[type]);
3249 3252
3250 /* allocate per filehandle data */ 3253 /* allocate per filehandle data */
3251 fh = kmalloc(sizeof(*fh),GFP_KERNEL); 3254 fh = kmalloc(sizeof(*fh),GFP_KERNEL);
3252 if (NULL == fh) 3255 if (NULL == fh) {
3256 unlock_kernel();
3253 return -ENOMEM; 3257 return -ENOMEM;
3258 }
3254 file->private_data = fh; 3259 file->private_data = fh;
3255 *fh = btv->init; 3260 *fh = btv->init;
3256 fh->type = type; 3261 fh->type = type;
@@ -3290,6 +3295,7 @@ static int bttv_open(struct inode *inode, struct file *file)
3290 bttv_vbi_fmt_reset(&fh->vbi_fmt, btv->tvnorm); 3295 bttv_vbi_fmt_reset(&fh->vbi_fmt, btv->tvnorm);
3291 3296
3292 bttv_field_count(btv); 3297 bttv_field_count(btv);
3298 unlock_kernel();
3293 return 0; 3299 return 0;
3294} 3300}
3295 3301
@@ -3430,21 +3436,26 @@ static int radio_open(struct inode *inode, struct file *file)
3430 3436
3431 dprintk("bttv: open minor=%d\n",minor); 3437 dprintk("bttv: open minor=%d\n",minor);
3432 3438
3439 lock_kernel();
3433 for (i = 0; i < bttv_num; i++) { 3440 for (i = 0; i < bttv_num; i++) {
3434 if (bttvs[i].radio_dev && bttvs[i].radio_dev->minor == minor) { 3441 if (bttvs[i].radio_dev && bttvs[i].radio_dev->minor == minor) {
3435 btv = &bttvs[i]; 3442 btv = &bttvs[i];
3436 break; 3443 break;
3437 } 3444 }
3438 } 3445 }
3439 if (NULL == btv) 3446 if (NULL == btv) {
3447 unlock_kernel();
3440 return -ENODEV; 3448 return -ENODEV;
3449 }
3441 3450
3442 dprintk("bttv%d: open called (radio)\n",btv->c.nr); 3451 dprintk("bttv%d: open called (radio)\n",btv->c.nr);
3443 3452
3444 /* allocate per filehandle data */ 3453 /* allocate per filehandle data */
3445 fh = kmalloc(sizeof(*fh), GFP_KERNEL); 3454 fh = kmalloc(sizeof(*fh), GFP_KERNEL);
3446 if (NULL == fh) 3455 if (NULL == fh) {
3456 unlock_kernel();
3447 return -ENOMEM; 3457 return -ENOMEM;
3458 }
3448 file->private_data = fh; 3459 file->private_data = fh;
3449 *fh = btv->init; 3460 *fh = btv->init;
3450 v4l2_prio_open(&btv->prio, &fh->prio); 3461 v4l2_prio_open(&btv->prio, &fh->prio);
@@ -3457,6 +3468,7 @@ static int radio_open(struct inode *inode, struct file *file)
3457 audio_input(btv,TVAUDIO_INPUT_RADIO); 3468 audio_input(btv,TVAUDIO_INPUT_RADIO);
3458 3469
3459 mutex_unlock(&btv->lock); 3470 mutex_unlock(&btv->lock);
3471 unlock_kernel();
3460 return 0; 3472 return 0;
3461} 3473}
3462 3474