summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/se401.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/se401.c')
-rw-r--r--linux/drivers/media/video/se401.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/se401.c b/linux/drivers/media/video/se401.c
index f59d63618..04897413d 100644
--- a/linux/drivers/media/video/se401.c
+++ b/linux/drivers/media/video/se401.c
@@ -944,14 +944,18 @@ static int se401_open(struct inode *inode, struct file *file)
struct usb_se401 *se401 = (struct usb_se401 *)dev;
int err = 0;
- if (se401->user)
+ lock_kernel();
+ if (se401->user) {
+ unlock_kernel();
return -EBUSY;
+ }
se401->fbuf = rvmalloc(se401->maxframesize * SE401_NUMFRAMES);
if (se401->fbuf)
file->private_data = dev;
else
err = -ENOMEM;
se401->user = !err;
+ unlock_kernel();
return err;
}