diff mbox series

ASoC: Use memset_io to access I/O memory

Message ID 1600423219-29058-2-git-send-email-shane.chien@mediatek.com (mailing list archive)
State New, archived
Headers show
Series ASoC: Use memset_io to access I/O memory | expand

Commit Message

Shane Chien Sept. 18, 2020, 10 a.m. UTC
From: "Shane.Chien" <shane.chien@mediatek.com>

Use memset_io to access I/O memory, instead of
memset.

Signed-off-by: Shane.Chien <shane.chien@mediatek.com>
---
 sound/core/pcm_native.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Sept. 18, 2020, 11:01 a.m. UTC | #1
On Fri, Sep 18, 2020 at 06:00:19PM +0800, Shane Chien wrote:

>  	/* clear the buffer for avoiding possible kernel info leaks */
>  	if (runtime->dma_area && !substream->ops->copy_user)
> -		memset(runtime->dma_area, 0, runtime->dma_bytes);
> +		memset_io(runtime->dma_area, 0, runtime->dma_bytes);

This is regular RAM that will be accessed by the devices rather than
memory mapped regions provided by devices, the _io variants are normally
for memory mapped regions on devices.
diff mbox series

Patch

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 9e0b2d7..a4efa84 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -756,7 +756,7 @@  static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
 
 	/* clear the buffer for avoiding possible kernel info leaks */
 	if (runtime->dma_area && !substream->ops->copy_user)
-		memset(runtime->dma_area, 0, runtime->dma_bytes);
+		memset_io(runtime->dma_area, 0, runtime->dma_bytes);
 
 	snd_pcm_timer_resolution_change(substream);
 	snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP);