diff options
Diffstat (limited to 'sound/oss/msnd_pinnacle.c')
-rw-r--r-- | sound/oss/msnd_pinnacle.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c index a1e3f9671bea..153d822bf9a3 100644 --- a/sound/oss/msnd_pinnacle.c +++ b/sound/oss/msnd_pinnacle.c | |||
@@ -756,12 +756,15 @@ static int dev_open(struct inode *inode, struct file *file) | |||
756 | int minor = iminor(inode); | 756 | int minor = iminor(inode); |
757 | int err = 0; | 757 | int err = 0; |
758 | 758 | ||
759 | lock_kernel(); | ||
759 | if (minor == dev.dsp_minor) { | 760 | if (minor == dev.dsp_minor) { |
760 | if ((file->f_mode & FMODE_WRITE && | 761 | if ((file->f_mode & FMODE_WRITE && |
761 | test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || | 762 | test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || |
762 | (file->f_mode & FMODE_READ && | 763 | (file->f_mode & FMODE_READ && |
763 | test_bit(F_AUDIO_READ_INUSE, &dev.flags))) | 764 | test_bit(F_AUDIO_READ_INUSE, &dev.flags))) { |
764 | return -EBUSY; | 765 | err = -EBUSY; |
766 | goto out; | ||
767 | } | ||
765 | 768 | ||
766 | if ((err = dsp_open(file)) >= 0) { | 769 | if ((err = dsp_open(file)) >= 0) { |
767 | dev.nresets = 0; | 770 | dev.nresets = 0; |
@@ -782,7 +785,8 @@ static int dev_open(struct inode *inode, struct file *file) | |||
782 | /* nothing */ | 785 | /* nothing */ |
783 | } else | 786 | } else |
784 | err = -EINVAL; | 787 | err = -EINVAL; |
785 | 788 | out: | |
789 | unlock_kernel(); | ||
786 | return err; | 790 | return err; |
787 | } | 791 | } |
788 | 792 | ||