From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BCDEC41621 for ; Tue, 24 Mar 2020 13:12:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8CCE208D5 for ; Tue, 24 Mar 2020 13:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585055576; bh=u0oxV+ZE30Cvfe5WC10gcHtQGNHrKMYUrIi5VvOstjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OQ9GEEXB5EdTaM7RTdAr44QwkkgVQFUtZI0GNkPtg+s6i2nCpvJ3LuTSe5bbVwhpy wfnxONnKhb6FOXoGlxWBTsQTe9qrMgEQGj93vE+MaU6W8XrJxMTu+ixSHYrL0wAgMM EeK2bxTAp0KVa5K5RtLPoNKNB+K31Aze9LJeWPME= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbgCXNMx (ORCPT ); Tue, 24 Mar 2020 09:12:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:58814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727736AbgCXNMw (ORCPT ); Tue, 24 Mar 2020 09:12:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5FEA320775; Tue, 24 Mar 2020 13:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585055570; bh=u0oxV+ZE30Cvfe5WC10gcHtQGNHrKMYUrIi5VvOstjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lPfP74ToJZW0nUovBsvCR8hcmkoJAQsXE0wIWINOYdT0tk2Y/TcETq9gFn40tch9E e49o2stc0i2r6NHy2iJAP9Hgq3OlUPgGmanRqTm9b4xWBfmxMUrmc+uRhr+/L7D6xR 61TwkZi5Zt3sh/sGJ2FLIE5EWEKdUBRyjctGP4Ss= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Steinmetz , Takashi Iwai Subject: [PATCH 4.19 27/65] ALSA: seq: virmidi: Fix running status after receiving sysex Date: Tue, 24 Mar 2020 14:10:48 +0100 Message-Id: <20200324130800.693038974@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200324130756.679112147@linuxfoundation.org> References: <20200324130756.679112147@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Takashi Iwai commit 4384f167ce5fa7241b61bb0984d651bc528ddebe upstream. The virmidi driver handles sysex event exceptionally in a short-cut snd_seq_dump_var_event() call, but this missed the reset of the running status. As a result, it may lead to an incomplete command right after the sysex when an event with the same running status was queued. Fix it by clearing the running status properly via alling snd_midi_event_reset_decode() for that code path. Reported-by: Andreas Steinmetz Cc: Link: https://lore.kernel.org/r/3b4a4e0f232b7afbaf0a843f63d0e538e3029bfd.camel@domdv.de Link: https://lore.kernel.org/r/20200316090506.23966-2-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/seq/seq_virmidi.c | 1 + 1 file changed, 1 insertion(+) --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -95,6 +95,7 @@ static int snd_virmidi_dev_receive_event if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE) continue; snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream); + snd_midi_event_reset_decode(vmidi->parser); } else { len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev); if (len > 0)