diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2021-12-28 11:40:26 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-27 08:47:36 +0100 |
commit | 9cb4c5b9ef0e63eda0b453ec2d9d0356a6e2adc8 (patch) | |
tree | 8f78f53ac3d7d04ae44eafd2bc8b844603d07247 /sound | |
parent | 76b9517e6902a8292f2ecf6feccb7f8d3275b037 (diff) |
ASoC: samsung: idma: Check of ioremap return value
[ Upstream commit 3ecb46755eb85456b459a1a9f952c52986bce8ec ]
Because of the potential failure of the ioremap(), the buf->area could
be NULL.
Therefore, we need to check it and return -ENOMEM in order to transfer
the error.
Fixes: f09aecd50f39 ("ASoC: SAMSUNG: Add I2S0 internal dma driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20211228034026.1659385-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/samsung/idma.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index 3e408158625d..72014dea7542 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -369,6 +369,8 @@ static int preallocate_idma_buffer(struct snd_pcm *pcm, int stream) buf->addr = idma.lp_tx_addr; buf->bytes = idma_hardware.buffer_bytes_max; buf->area = (unsigned char * __force)ioremap(buf->addr, buf->bytes); + if (!buf->area) + return -ENOMEM; return 0; } |