aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/stradis.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/stradis.c')
-rw-r--r--drivers/media/video/stradis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 276bded06ab..a3cbe9be3c1 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -1882,12 +1882,16 @@ static int saa_open(struct inode *inode, struct file *file)
struct video_device *vdev = video_devdata(file);
struct saa7146 *saa = container_of(vdev, struct saa7146, video_dev);
+ lock_kernel();
file->private_data = saa;
saa->user++;
- if (saa->user > 1)
+ if (saa->user > 1) {
+ unlock_kernel();
return 0; /* device open already, don't reset */
+ }
saa->writemode = VID_WRITE_MPEG_VID; /* default to video */
+ unlock_kernel();
return 0;
}