Skip to content

Commit a17f93a

Browse files
JiangJiasgregkh
authored andcommitted
ASoC: samsung: idma: Check of ioremap return value
[ Upstream commit 3ecb467 ] 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: f09aecd ("ASoC: SAMSUNG: Add I2S0 internal dma driver") Signed-off-by: Jiasheng Jiang <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8b5d696 commit a17f93a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/soc/samsung/idma.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ static int preallocate_idma_buffer(struct snd_pcm *pcm, int stream)
360360
buf->addr = idma.lp_tx_addr;
361361
buf->bytes = idma_hardware.buffer_bytes_max;
362362
buf->area = (unsigned char * __force)ioremap(buf->addr, buf->bytes);
363+
if (!buf->area)
364+
return -ENOMEM;
363365

364366
return 0;
365367
}

0 commit comments

Comments
 (0)