aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zr364xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/zr364xx.c')
-rw-r--r--drivers/media/video/zr364xx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index 18d1c4ba79fb..4e1ef10d22df 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -643,14 +643,18 @@ static int zr364xx_open(struct inode *inode, struct file *file)
643 643
644 cam->skip = 2; 644 cam->skip = 2;
645 645
646 lock_kernel();
646 err = video_exclusive_open(inode, file); 647 err = video_exclusive_open(inode, file);
647 if (err < 0) 648 if (err < 0) {
649 unlock_kernel();
648 return err; 650 return err;
651 }
649 652
650 if (!cam->framebuf) { 653 if (!cam->framebuf) {
651 cam->framebuf = vmalloc_32(MAX_FRAME_SIZE * FRAMES); 654 cam->framebuf = vmalloc_32(MAX_FRAME_SIZE * FRAMES);
652 if (!cam->framebuf) { 655 if (!cam->framebuf) {
653 info("vmalloc_32 failed!"); 656 info("vmalloc_32 failed!");
657 unlock_kernel();
654 return -ENOMEM; 658 return -ENOMEM;
655 } 659 }
656 } 660 }
@@ -664,6 +668,7 @@ static int zr364xx_open(struct inode *inode, struct file *file)
664 if (err < 0) { 668 if (err < 0) {
665 info("error during open sequence: %d", i); 669 info("error during open sequence: %d", i);
666 mutex_unlock(&cam->lock); 670 mutex_unlock(&cam->lock);
671 unlock_kernel();
667 return err; 672 return err;
668 } 673 }
669 } 674 }
@@ -676,6 +681,7 @@ static int zr364xx_open(struct inode *inode, struct file *file)
676 mdelay(100); 681 mdelay(100);
677 682
678 mutex_unlock(&cam->lock); 683 mutex_unlock(&cam->lock);
684 unlock_kernel();
679 return 0; 685 return 0;
680} 686}
681 687