Skip to content

Commit c8de6db

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-lib: Restrict calling flush_context_completion() when context exists
Currently, drivers can bring XRUN state for PCM substreams when error to queue packets or detecting discontinuity of packet. The application may try to recover this state by calling snd_pcm_prepare(). Depending on each driver, .prepare() includes restart streaming. Then there is a state that PCM substreams are running but isochronous contexts are stopped. In this case, when .pointer() is called, it refers to error pointer. This commit is for a prevention of this bug. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 7b2d99f commit c8de6db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/firewire/amdtp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ EXPORT_SYMBOL(amdtp_stream_start);
898898
unsigned long amdtp_stream_pcm_pointer(struct amdtp_stream *s)
899899
{
900900
/* this optimization is allowed to be racy */
901-
if (s->pointer_flush)
901+
if (s->pointer_flush && amdtp_stream_running(s))
902902
fw_iso_context_flush_completions(s->context);
903903
else
904904
s->pointer_flush = true;

0 commit comments

Comments
 (0)