ALSA: msnd: Optimize / harden DSP and MIDI loops
authorTakashi Iwai <tiwai@suse.de>
Thu, 6 Jul 2017 10:34:40 +0000 (12:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2017 21:13:36 +0000 (14:13 -0700)
commit03bea515b9a2f2a48d46a5a4bcc69be264afb6af
tree1286cf0cab89b8dbd9f0f160a77e006fbd261e6f
parentd21f3eaa09c0dcbf7930ec3b127cbacbfba99bb5
ALSA: msnd: Optimize / harden DSP and MIDI loops

commit 20e2b791796bd68816fa115f12be5320de2b8021 upstream.

The ISA msnd drivers have loops fetching the ring-buffer head, tail
and size values inside the loops.  Such codes are inefficient and
fragile.

This patch optimizes it, and also adds the sanity check to avoid the
endless loops.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196131
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196133
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: grygorii tertychnyi <gtertych@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/isa/msnd/msnd_midi.c
sound/isa/msnd/msnd_pinnacle.c