ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
authorTakashi Iwai <tiwai@suse.de>
Mon, 25 Jan 2016 10:01:47 +0000 (11:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:30:58 +0000 (12:30 -0800)
commitfa8fcbe38317a90094a29120ea959fb361b895fb
treee05ec199c44efc234bbd851486f6a0ad8fc6d6cd
parentd0cc6515b1238f90c61b713160e94ff768b43325
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/seq/oss/seq_oss_synth.c