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:17:30 +0000 (14:17 -0700)
commit9d6412aa06ce75e44fbaf1bfa15454150fd6a803
treecc9142cd253c35f6b13fbc93b0987f15d185e831
parent846073130799031e6e1e8a692d96438105c4edf6
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