ASoC: samsung: idma: Check of ioremap return value
[ Upstream commit3ecb46755e] 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:f09aecd50f("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>
This commit is contained in:
parent
d491a2c2cf
commit
696a50abbc
1 changed files with 2 additions and 0 deletions
|
|
@ -360,6 +360,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue