summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/stk-webcam.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/stk-webcam.c')
-rw-r--r--linux/drivers/media/video/stk-webcam.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/stk-webcam.c b/linux/drivers/media/video/stk-webcam.c
index e18745a67..c6660b363 100644
--- a/linux/drivers/media/video/stk-webcam.c
+++ b/linux/drivers/media/video/stk-webcam.c
@@ -690,11 +690,15 @@ static int v4l_stk_open(struct inode *inode, struct file *fp)
vdev = video_devdata(fp);
dev = vdev_to_camera(vdev);
- if (dev == NULL || !is_present(dev))
+ lock_kernel();
+ if (dev == NULL || !is_present(dev)) {
+ unlock_kernel();
return -ENXIO;
+ }
fp->private_data = vdev;
kref_get(&dev->kref);
usb_autopm_get_interface(dev->interface);
+ unlock_kernel();
return 0;
}