ASoC: intel: atom: Fix reference to PCM buffer address
authorTakashi Iwai <tiwai@suse.de>
Wed, 28 Jul 2021 11:23:50 +0000 (13:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Aug 2021 06:59:05 +0000 (08:59 +0200)
commitb8bceace43dd8c0cd9239c09eb7fe526328d4b44
tree8e02983d496228d8e65d20d83fc6278fedacf3f1
parent261613ef340b63cdd054a1320ce9682e5c6660c5
ASoC: intel: atom: Fix reference to PCM buffer address

commit 2e6b836312a477d647a7920b56810a5a25f6c856 upstream.

PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer.  The address should be retrieved from runtime->dma_addr,
instead of substream->dma_buffer (and shouldn't use virt_to_phys).

Also, remove the line overriding runtime->dma_area superfluously,
which was already set up at the PCM buffer allocation.

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210728112353.6675-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/intel/atom/sst-mfld-platform-pcm.c