diff options
| -rw-r--r-- | drivers/media/video/videodev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 31e8af0ba278..e5679c28163f 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
| 37 | #include <linux/kmod.h> | 37 | #include <linux/kmod.h> |
| 38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
| 39 | #include <linux/smp_lock.h> | ||
| 39 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
| 40 | #include <asm/system.h> | 41 | #include <asm/system.h> |
| 41 | 42 | ||
| @@ -496,6 +497,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
| 496 | 497 | ||
| 497 | if(minor>=VIDEO_NUM_DEVICES) | 498 | if(minor>=VIDEO_NUM_DEVICES) |
| 498 | return -ENODEV; | 499 | return -ENODEV; |
| 500 | lock_kernel(); | ||
| 499 | mutex_lock(&videodev_lock); | 501 | mutex_lock(&videodev_lock); |
| 500 | vfl=video_device[minor]; | 502 | vfl=video_device[minor]; |
| 501 | if(vfl==NULL) { | 503 | if(vfl==NULL) { |
| @@ -505,6 +507,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
| 505 | vfl=video_device[minor]; | 507 | vfl=video_device[minor]; |
| 506 | if (vfl==NULL) { | 508 | if (vfl==NULL) { |
| 507 | mutex_unlock(&videodev_lock); | 509 | mutex_unlock(&videodev_lock); |
| 510 | unlock_kernel(); | ||
| 508 | return -ENODEV; | 511 | return -ENODEV; |
| 509 | } | 512 | } |
| 510 | } | 513 | } |
| @@ -518,6 +521,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
| 518 | } | 521 | } |
| 519 | fops_put(old_fops); | 522 | fops_put(old_fops); |
| 520 | mutex_unlock(&videodev_lock); | 523 | mutex_unlock(&videodev_lock); |
| 524 | unlock_kernel(); | ||
| 521 | return err; | 525 | return err; |
| 522 | } | 526 | } |
| 523 | 527 | ||
