ALSA: pcm: Don't call sync_stop if it hasn't been stopped
authorTakashi Iwai <tiwai@suse.de>
Sat, 6 Feb 2021 20:36:55 +0000 (21:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:19 +0000 (11:37 +0100)
commitde7e30da243f104c83423c9f73dcd5938dbdf296
treefb1d4e8417ccefca1bc078a613b170c25b8a5fa4
parent7011cd4599ef80bad9453a3e4ea0aa3f86ff5e3f
ALSA: pcm: Don't call sync_stop if it hasn't been stopped

commit 700cb70730777c159a988e01daa93f20a1ae9b58 upstream.

The PCM stop operation sets the stop_operating flag for indicating the
sync_stop post-process.  This flag is, however, set unconditionally
even if the PCM trigger weren't issued.  This may lead to
inconsistency in the driver side.

Correct the code to set stop_operating flag only after the trigger
STOP is actually called.

Fixes: 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210206203656.15959-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm_native.c