Hi,
here is a small patch set for ALSA core rawmidi code to make the code a bit more robust, especially for the case where the exported functions get called from the external drivers. Currently most of those functions assume naively that they aren't called at a wrong timing. With the patch set, it tries to harden a bit not to hit serious breakage.
Takashi
===
Takashi Iwai (5): ALSA: rawmidi: Make internal functions local static ALSA: rawmidi: Move lock to snd_rawmidi_substream ALSA: rawmidi: Take open_mutex around parameter changes ALSA: rawmidi: Check stream state at exported functions ALSA: rawmidi: Take buffer refcount while draining output
include/sound/rawmidi.h | 6 +- sound/core/rawmidi.c | 274 +++++++++++++++++++++++++--------------- 2 files changed, 170 insertions(+), 110 deletions(-)