diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-01-25 13:01:47 +0300 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2016-02-17 13:22:34 +0300 |
commit | f4d82a3e4190777546be75de24fbdf0ba4af2b20 (patch) | |
tree | 07074e5ffd9a2268b8582a7aeb108a703b55ad3a | |
parent | 0fa4f3b172c557053db41e264067d59a2db32dde (diff) | |
download | linux-f4d82a3e4190777546be75de24fbdf0ba4af2b20.tar.xz |
ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
commit 599151336638d57b98d92338aa59c048e3a3e97d upstream.
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 <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
-rw-r--r-- | sound/core/seq/oss/seq_oss_synth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c index 701feb71b700..ac3d7d2125e9 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]; |