ALSA: dmaengine: increment buffer pointer atomically
authorAndreas Pape <apape@de.adit-jv.com>
Mon, 26 Sep 2022 16:58:13 +0000 (18:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:56 +0000 (12:34 +0200)
commitb14dc262274b01880190d8243f28eedab90697e9
treee579a3d7845dd0ec58867fc2bb4da046ce3f0d13
parentf5f1f5ee5048cfa7bd07f496b33bd2cfc198a176
ALSA: dmaengine: increment buffer pointer atomically

[ Upstream commit d1c442019594692c64a70a86ad88eb5b6db92216 ]

Setting pointer and afterwards checking for wraparound leads
to the possibility of returning the inconsistent pointer position.

This patch increments buffer pointer atomically to avoid this issue.

Fixes: e7f73a1613567a ("ASoC: Add dmaengine PCM helper functions")
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Link: https://lore.kernel.org/r/1664211493-11789-1-git-send-email-erosca@de.adit-jv.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/core/pcm_dmaengine.c