aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c4
-rw-r--r--drivers/media/radio/miropcm20-rds.c4
-rw-r--r--drivers/media/video/videodev.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 8b56d929f7f..e208a60c048 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -32,6 +32,7 @@
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include "dvbdev.h"
static int dvbdev_debug;
@@ -74,6 +75,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
{
struct dvb_device *dvbdev;
+ lock_kernel();
dvbdev = dvbdev_find_device (iminor(inode));
if (dvbdev && dvbdev->fops) {
@@ -90,8 +92,10 @@ static int dvb_device_open(struct inode *inode, struct file *file)
file->f_op = fops_get(old_fops);
}
fops_put(old_fops);
+ unlock_kernel();
return err;
}
+ unlock_kernel();
return -ENODEV;
}
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c
index 06dfed9ef4c..3e840f74d45 100644
--- a/drivers/media/radio/miropcm20-rds.c
+++ b/drivers/media/radio/miropcm20-rds.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/smp_lock.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/delay.h>
@@ -27,13 +28,16 @@ static int rds_f_open(struct inode *in, struct file *fi)
if (rds_users)
return -EBUSY;
+ lock_kernel();
rds_users++;
if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) {
rds_users--;
printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n");
+ unlock_kernel();
return -ENOMEM;
}
+ unlock_kernel();
return 0;
}
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 67a661cf521..7649860a388 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/slab.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -442,6 +443,7 @@ static int video_open(struct inode *inode, struct file *file)
if(minor>=VIDEO_NUM_DEVICES)
return -ENODEV;
+ lock_kernel();
mutex_lock(&videodev_lock);
vfl=video_device[minor];
if(vfl==NULL) {
@@ -451,6 +453,7 @@ static int video_open(struct inode *inode, struct file *file)
vfl=video_device[minor];
if (vfl==NULL) {
mutex_unlock(&videodev_lock);
+ unlock_kernel();
return -ENODEV;
}
}
@@ -464,6 +467,7 @@ static int video_open(struct inode *inode, struct file *file)
}
fops_put(old_fops);
mutex_unlock(&videodev_lock);
+ unlock_kernel();
return err;
}