aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 00306faeac01..26ffaa276c51 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -932,6 +932,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
932 unsigned int input_cnt,idx; 932 unsigned int input_cnt,idx;
933 int ret = 0; 933 int ret = 0;
934 934
935 lock_kernel();
935 dip = container_of(video_devdata(file),struct pvr2_v4l2_dev,devbase); 936 dip = container_of(video_devdata(file),struct pvr2_v4l2_dev,devbase);
936 937
937 vp = dip->v4lp; 938 vp = dip->v4lp;
@@ -942,11 +943,13 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
942 if (!pvr2_hdw_dev_ok(hdw)) { 943 if (!pvr2_hdw_dev_ok(hdw)) {
943 pvr2_trace(PVR2_TRACE_OPEN_CLOSE, 944 pvr2_trace(PVR2_TRACE_OPEN_CLOSE,
944 "pvr2_v4l2_open: hardware not ready"); 945 "pvr2_v4l2_open: hardware not ready");
946 unlock_kernel();
945 return -EIO; 947 return -EIO;
946 } 948 }
947 949
948 fhp = kzalloc(sizeof(*fhp),GFP_KERNEL); 950 fhp = kzalloc(sizeof(*fhp),GFP_KERNEL);
949 if (!fhp) { 951 if (!fhp) {
952 unlock_kernel();
950 return -ENOMEM; 953 return -ENOMEM;
951 } 954 }
952 955
@@ -976,6 +979,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
976 fhp); 979 fhp);
977 980
978 kfree(fhp); 981 kfree(fhp);
982 unlock_kernel();
979 return ret; 983 return ret;
980 } 984 }
981 985
@@ -992,6 +996,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
992 "Destroying pvr_v4l2_fh id=%p (input map failure)", 996 "Destroying pvr_v4l2_fh id=%p (input map failure)",
993 fhp); 997 fhp);
994 kfree(fhp); 998 kfree(fhp);
999 unlock_kernel();
995 return -ENOMEM; 1000 return -ENOMEM;
996 } 1001 }
997 input_cnt = 0; 1002 input_cnt = 0;
@@ -1015,6 +1020,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file)
1015 v4l2_prio_open(&vp->prio,&fhp->prio); 1020 v4l2_prio_open(&vp->prio,&fhp->prio);
1016 1021
1017 fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw); 1022 fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw);
1023 unlock_kernel();
1018 1024
1019 return 0; 1025 return 0;
1020} 1026}