ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Apr 2018 05:26:59 +0000 (07:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 May 2018 19:58:16 +0000 (12:58 -0700)
commit4a52a2127240ea5149a83ab80c7adacb4e36e7a4
treeffd38ea6285e9931c510066e60bcd20afedcaabe
parent30ddc329d56281c0c1d038d5f572af3c31e6b0a6
ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device

commit f5e94b4c6ebdabe0f602d796e0430180927521a0 upstream.

When get_synthdev() is called for a MIDI device, it returns the fixed
midi_synth_dev without the use refcounting.  OTOH, the caller is
supposed to unreference unconditionally after the usage, so this would
lead to unbalanced refcount.

This patch corrects the behavior and keep up the refcount balance also
for the MIDI synth device.

Cc: <stable@vger.kernel.org>
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