aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/vwsnd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/vwsnd.c')
-rw-r--r--sound/oss/vwsnd.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
index 20b3b325aa80..8cd73cdd88af 100644
--- a/sound/oss/vwsnd.c
+++ b/sound/oss/vwsnd.c
@@ -2429,8 +2429,7 @@ static unsigned int vwsnd_audio_poll(struct file *file,
2429 return mask; 2429 return mask;
2430} 2430}
2431 2431
2432static int vwsnd_audio_do_ioctl(struct inode *inode, 2432static int vwsnd_audio_do_ioctl(struct file *file,
2433 struct file *file,
2434 unsigned int cmd, 2433 unsigned int cmd,
2435 unsigned long arg) 2434 unsigned long arg)
2436{ 2435{
@@ -2446,8 +2445,8 @@ static int vwsnd_audio_do_ioctl(struct inode *inode,
2446 int ival; 2445 int ival;
2447 2446
2448 2447
2449 DBGEV("(inode=0x%p, file=0x%p, cmd=0x%x, arg=0x%lx)\n", 2448 DBGEV("(file=0x%p, cmd=0x%x, arg=0x%lx)\n",
2450 inode, file, cmd, arg); 2449 file, cmd, arg);
2451 switch (cmd) { 2450 switch (cmd) {
2452 case OSS_GETVERSION: /* _SIOR ('M', 118, int) */ 2451 case OSS_GETVERSION: /* _SIOR ('M', 118, int) */
2453 DBGX("OSS_GETVERSION\n"); 2452 DBGX("OSS_GETVERSION\n");
@@ -2885,17 +2884,19 @@ static int vwsnd_audio_do_ioctl(struct inode *inode,
2885 return -EINVAL; 2884 return -EINVAL;
2886} 2885}
2887 2886
2888static int vwsnd_audio_ioctl(struct inode *inode, 2887static long vwsnd_audio_ioctl(struct file *file,
2889 struct file *file,
2890 unsigned int cmd, 2888 unsigned int cmd,
2891 unsigned long arg) 2889 unsigned long arg)
2892{ 2890{
2893 vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data; 2891 vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data;
2894 int ret; 2892 int ret;
2895 2893
2894 lock_kernel();
2896 mutex_lock(&devc->io_mutex); 2895 mutex_lock(&devc->io_mutex);
2897 ret = vwsnd_audio_do_ioctl(inode, file, cmd, arg); 2896 ret = vwsnd_audio_do_ioctl(file, cmd, arg);
2898 mutex_unlock(&devc->io_mutex); 2897 mutex_unlock(&devc->io_mutex);
2898 unlock_kernel();
2899
2899 return ret; 2900 return ret;
2900} 2901}
2901 2902
@@ -2921,6 +2922,7 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
2921 2922
2922 DBGE("(inode=0x%p, file=0x%p)\n", inode, file); 2923 DBGE("(inode=0x%p, file=0x%p)\n", inode, file);
2923 2924
2925 lock_kernel();
2924 INC_USE_COUNT; 2926 INC_USE_COUNT;
2925 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev) 2927 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)
2926 if ((devc->audio_minor & ~0x0F) == (minor & ~0x0F)) 2928 if ((devc->audio_minor & ~0x0F) == (minor & ~0x0F))
@@ -2928,6 +2930,7 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
2928 2930
2929 if (devc == NULL) { 2931 if (devc == NULL) {
2930 DEC_USE_COUNT; 2932 DEC_USE_COUNT;
2933 unlock_kernel();
2931 return -ENODEV; 2934 return -ENODEV;
2932 } 2935 }
2933 2936
@@ -2936,11 +2939,13 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
2936 mutex_unlock(&devc->open_mutex); 2939 mutex_unlock(&devc->open_mutex);
2937 if (file->f_flags & O_NONBLOCK) { 2940 if (file->f_flags & O_NONBLOCK) {
2938 DEC_USE_COUNT; 2941 DEC_USE_COUNT;
2942 unlock_kernel();
2939 return -EBUSY; 2943 return -EBUSY;
2940 } 2944 }
2941 interruptible_sleep_on(&devc->open_wait); 2945 interruptible_sleep_on(&devc->open_wait);
2942 if (signal_pending(current)) { 2946 if (signal_pending(current)) {
2943 DEC_USE_COUNT; 2947 DEC_USE_COUNT;
2948 unlock_kernel();
2944 return -ERESTARTSYS; 2949 return -ERESTARTSYS;
2945 } 2950 }
2946 mutex_lock(&devc->open_mutex); 2951 mutex_lock(&devc->open_mutex);
@@ -2993,6 +2998,7 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
2993 2998
2994 file->private_data = devc; 2999 file->private_data = devc;
2995 DBGRV(); 3000 DBGRV();
3001 unlock_kernel();
2996 return 0; 3002 return 0;
2997} 3003}
2998 3004
@@ -3044,7 +3050,7 @@ static const struct file_operations vwsnd_audio_fops = {
3044 .read = vwsnd_audio_read, 3050 .read = vwsnd_audio_read,
3045 .write = vwsnd_audio_write, 3051 .write = vwsnd_audio_write,
3046 .poll = vwsnd_audio_poll, 3052 .poll = vwsnd_audio_poll,
3047 .ioctl = vwsnd_audio_ioctl, 3053 .unlocked_ioctl = vwsnd_audio_ioctl,
3048 .mmap = vwsnd_audio_mmap, 3054 .mmap = vwsnd_audio_mmap,
3049 .open = vwsnd_audio_open, 3055 .open = vwsnd_audio_open,
3050 .release = vwsnd_audio_release, 3056 .release = vwsnd_audio_release,
@@ -3062,15 +3068,18 @@ static int vwsnd_mixer_open(struct inode *inode, struct file *file)
3062 DBGEV("(inode=0x%p, file=0x%p)\n", inode, file); 3068 DBGEV("(inode=0x%p, file=0x%p)\n", inode, file);
3063 3069
3064 INC_USE_COUNT; 3070 INC_USE_COUNT;
3071 lock_kernel();
3065 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev) 3072 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)
3066 if (devc->mixer_minor == iminor(inode)) 3073 if (devc->mixer_minor == iminor(inode))
3067 break; 3074 break;
3068 3075
3069 if (devc == NULL) { 3076 if (devc == NULL) {
3070 DEC_USE_COUNT; 3077 DEC_USE_COUNT;
3078 unlock_kernel();
3071 return -ENODEV; 3079 return -ENODEV;
3072 } 3080 }
3073 file->private_data = devc; 3081 file->private_data = devc;
3082 unlock_kernel();
3074 return 0; 3083 return 0;
3075} 3084}
3076 3085
@@ -3203,8 +3212,7 @@ static int mixer_write_ioctl(vwsnd_dev_t *devc, unsigned int nr, void __user *ar
3203 3212
3204/* This is the ioctl entry to the mixer driver. */ 3213/* This is the ioctl entry to the mixer driver. */
3205 3214
3206static int vwsnd_mixer_ioctl(struct inode *ioctl, 3215static long vwsnd_mixer_ioctl(struct file *file,
3207 struct file *file,
3208 unsigned int cmd, 3216 unsigned int cmd,
3209 unsigned long arg) 3217 unsigned long arg)
3210{ 3218{
@@ -3215,6 +3223,7 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
3215 3223
3216 DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg); 3224 DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg);
3217 3225
3226 lock_kernel();
3218 mutex_lock(&devc->mix_mutex); 3227 mutex_lock(&devc->mix_mutex);
3219 { 3228 {
3220 if ((cmd & ~nrmask) == MIXER_READ(0)) 3229 if ((cmd & ~nrmask) == MIXER_READ(0))
@@ -3225,13 +3234,14 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
3225 retval = -EINVAL; 3234 retval = -EINVAL;
3226 } 3235 }
3227 mutex_unlock(&devc->mix_mutex); 3236 mutex_unlock(&devc->mix_mutex);
3237 unlock_kernel();
3228 return retval; 3238 return retval;
3229} 3239}
3230 3240
3231static const struct file_operations vwsnd_mixer_fops = { 3241static const struct file_operations vwsnd_mixer_fops = {
3232 .owner = THIS_MODULE, 3242 .owner = THIS_MODULE,
3233 .llseek = no_llseek, 3243 .llseek = no_llseek,
3234 .ioctl = vwsnd_mixer_ioctl, 3244 .unlocked_ioctl = vwsnd_mixer_ioctl,
3235 .open = vwsnd_mixer_open, 3245 .open = vwsnd_mixer_open,
3236 .release = vwsnd_mixer_release, 3246 .release = vwsnd_mixer_release,
3237}; 3247};