From 3a63e44420932852efd6a7d6d46cdad4d427f880 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 13 Mar 2006 14:14:10 +0100 Subject: [ALSA] sound/core/: fix 3 off-by-one errors Modules: ALSA Core This patch fixes three off-by-one errors found by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Takashi Iwai --- sound/core/sound_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/core/sound_oss.c') 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]; -- cgit v1.2.3-18-g5258