]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: direct: Check xrun/suspend before the slave hwptr update
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Mar 2022 08:24:12 +0000 (09:24 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Mar 2022 11:58:51 +0000 (12:58 +0100)
commitbb9f258e192980bb6cbef74ac57e348553805a0c
tree9e190866960e268f4183a0f775ca64a7b0f3ad44
parent3577a7a26beb74285af776fbd499b519723a955a
pcm: direct: Check xrun/suspend before the slave hwptr update

The xrun/suspend may happen at any time and we should check it right
after the slave hwptr update (but before the actual sync_ptr update in
direct pcm side).  Otherwise the hwptr value may be screwed and get
unexpected large read/write.

Reported-by: S.J. Wang <shengjiu.wang@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_dmix.c
src/pcm/pcm_dshare.c
src/pcm/pcm_dsnoop.c