summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/core/sound.c4
-rw-r--r--sound/core/sound_oss.c2
2 files changed, 3 insertions, 3 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)
struct snd_minor *mreg;
void *private_data;
- if (minor > ARRAY_SIZE(snd_minors))
+ if (minor >= ARRAY_SIZE(snd_minors))
return NULL;
mutex_lock(&sound_mutex);
mreg = snd_minors[minor];
@@ -140,7 +140,7 @@ static int snd_open(struct inode *inode, struct file *file)
struct file_operations *old_fops;
int err = 0;
- if (minor > ARRAY_SIZE(snd_minors))
+ if (minor >= ARRAY_SIZE(snd_minors))
return -ENODEV;
mptr = snd_minors[minor];
if (mptr == NULL) {
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c
index 6b4a4bccd8f..4023d3b406d 100644
--- a/sound/core/sound_oss.c
+++ b/sound/core/sound_oss.c
@@ -46,7 +46,7 @@ void *snd_lookup_oss_minor_data(unsigned int minor, int type)
struct snd_minor *mreg;
void *private_data;
- if (minor > ARRAY_SIZE(snd_oss_minors))
+ if (minor >= ARRAY_SIZE(snd_oss_minors))
return NULL;
mutex_lock(&sound_oss_mutex);
mreg = snd_oss_minors[minor];