From: Takashi Iwai Date: Mon, 25 Jan 2016 10:01:47 +0000 (+0100) Subject: ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() X-Git-Tag: v4.5-rc2~26^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=599151336638d57b98d92338aa59c048e3a3e97d;p=platform%2Fkernel%2Flinux-exynos.git ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() ALSA sequencer OSS emulation code has a sanity check for currently opened devices, but there is a thinko there, eventually it spews warnings and skips the operation wrongly like: WARNING: CPU: 1 PID: 7573 at sound/core/seq/oss/seq_oss_synth.c:311 Fix this off-by-one error. Reported-by: Dmitry Vyukov Cc: Signed-off-by: Takashi Iwai --- diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c index 0f3b381..b16dbef 100644 --- a/sound/core/seq/oss/seq_oss_synth.c +++ b/sound/core/seq/oss/seq_oss_synth.c @@ -308,7 +308,7 @@ snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp) struct seq_oss_synth *rec; struct seq_oss_synthinfo *info; - if (snd_BUG_ON(dp->max_synthdev >= SNDRV_SEQ_OSS_MAX_SYNTH_DEVS)) + if (snd_BUG_ON(dp->max_synthdev > SNDRV_SEQ_OSS_MAX_SYNTH_DEVS)) return; for (i = 0; i < dp->max_synthdev; i++) { info = &dp->synths[i];