diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 4 | ||||
-rw-r--r-- | drivers/media/radio/miropcm20-rds.c | 4 | ||||
-rw-r--r-- | drivers/media/video/videodev.c | 4 |
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 8b56d929f7fd..e208a60c048a 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
33 | #include <linux/cdev.h> | 33 | #include <linux/cdev.h> |
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/smp_lock.h> | ||
35 | #include "dvbdev.h" | 36 | #include "dvbdev.h" |
36 | 37 | ||
37 | static int dvbdev_debug; | 38 | static int dvbdev_debug; |
@@ -74,6 +75,7 @@ static int dvb_device_open(struct inode *inode, struct file *file) | |||
74 | { | 75 | { |
75 | struct dvb_device *dvbdev; | 76 | struct dvb_device *dvbdev; |
76 | 77 | ||
78 | lock_kernel(); | ||
77 | dvbdev = dvbdev_find_device (iminor(inode)); | 79 | dvbdev = dvbdev_find_device (iminor(inode)); |
78 | 80 | ||
79 | if (dvbdev && dvbdev->fops) { | 81 | if (dvbdev && dvbdev->fops) { |
@@ -90,8 +92,10 @@ static int dvb_device_open(struct inode *inode, struct file *file) | |||
90 | file->f_op = fops_get(old_fops); | 92 | file->f_op = fops_get(old_fops); |
91 | } | 93 | } |
92 | fops_put(old_fops); | 94 | fops_put(old_fops); |
95 | unlock_kernel(); | ||
93 | return err; | 96 | return err; |
94 | } | 97 | } |
98 | unlock_kernel(); | ||
95 | return -ENODEV; | 99 | return -ENODEV; |
96 | } | 100 | } |
97 | 101 | ||
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c index 06dfed9ef4c7..3e840f74d45c 100644 --- a/drivers/media/radio/miropcm20-rds.c +++ b/drivers/media/radio/miropcm20-rds.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/smp_lock.h> | ||
15 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
16 | #include <linux/miscdevice.h> | 17 | #include <linux/miscdevice.h> |
17 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
@@ -27,13 +28,16 @@ static int rds_f_open(struct inode *in, struct file *fi) | |||
27 | if (rds_users) | 28 | if (rds_users) |
28 | return -EBUSY; | 29 | return -EBUSY; |
29 | 30 | ||
31 | lock_kernel(); | ||
30 | rds_users++; | 32 | rds_users++; |
31 | if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) { | 33 | if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) { |
32 | rds_users--; | 34 | rds_users--; |
33 | printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n"); | 35 | printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n"); |
36 | unlock_kernel(); | ||
34 | return -ENOMEM; | 37 | return -ENOMEM; |
35 | } | 38 | } |
36 | 39 | ||
40 | unlock_kernel(); | ||
37 | return 0; | 41 | return 0; |
38 | } | 42 | } |
39 | 43 | ||
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 67a661cf5219..7649860a388d 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 | ||
@@ -442,6 +443,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
442 | 443 | ||
443 | if(minor>=VIDEO_NUM_DEVICES) | 444 | if(minor>=VIDEO_NUM_DEVICES) |
444 | return -ENODEV; | 445 | return -ENODEV; |
446 | lock_kernel(); | ||
445 | mutex_lock(&videodev_lock); | 447 | mutex_lock(&videodev_lock); |
446 | vfl=video_device[minor]; | 448 | vfl=video_device[minor]; |
447 | if(vfl==NULL) { | 449 | if(vfl==NULL) { |
@@ -451,6 +453,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
451 | vfl=video_device[minor]; | 453 | vfl=video_device[minor]; |
452 | if (vfl==NULL) { | 454 | if (vfl==NULL) { |
453 | mutex_unlock(&videodev_lock); | 455 | mutex_unlock(&videodev_lock); |
456 | unlock_kernel(); | ||
454 | return -ENODEV; | 457 | return -ENODEV; |
455 | } | 458 | } |
456 | } | 459 | } |
@@ -464,6 +467,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
464 | } | 467 | } |
465 | fops_put(old_fops); | 468 | fops_put(old_fops); |
466 | mutex_unlock(&videodev_lock); | 469 | mutex_unlock(&videodev_lock); |
470 | unlock_kernel(); | ||
467 | return err; | 471 | return err; |
468 | } | 472 | } |
469 | 473 | ||