diff options
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r-- | sound/core/sound.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c index df4ab94d006..4d28e521261 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -121,7 +121,7 @@ void *snd_lookup_minor_data(unsigned int minor, int type) | |||
121 | struct snd_minor *mreg; | 121 | struct snd_minor *mreg; |
122 | void *private_data; | 122 | void *private_data; |
123 | 123 | ||
124 | if (minor > ARRAY_SIZE(snd_minors)) | 124 | if (minor >= ARRAY_SIZE(snd_minors)) |
125 | return NULL; | 125 | return NULL; |
126 | mutex_lock(&sound_mutex); | 126 | mutex_lock(&sound_mutex); |
127 | mreg = snd_minors[minor]; | 127 | mreg = snd_minors[minor]; |
@@ -140,7 +140,7 @@ static int snd_open(struct inode *inode, struct file *file) | |||
140 | struct file_operations *old_fops; | 140 | struct file_operations *old_fops; |
141 | int err = 0; | 141 | int err = 0; |
142 | 142 | ||
143 | if (minor > ARRAY_SIZE(snd_minors)) | 143 | if (minor >= ARRAY_SIZE(snd_minors)) |
144 | return -ENODEV; | 144 | return -ENODEV; |
145 | mptr = snd_minors[minor]; | 145 | mptr = snd_minors[minor]; |
146 | if (mptr == NULL) { | 146 | if (mptr == NULL) { |