Skip to contentSkip to conversation

ASoC: samsung: idma: Check of ioremap return value

PATCH In review Jiasheng Jiang 3 participants 3 messages Dec 28, 2021 – Dec 29, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: samsung: idma: Check of ioremap return value

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")
---
 sound/soc/samsung/idma.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/samsung/idma.c +2 -0
index 66bcc2f97544..c3f1b054e238 100644
@@ -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;
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jiasheng Jiang

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")
---
 sound/soc/samsung/idma.c | 2 ++
 1 file changed, 2 insertions(+)

Best regards,
Krzysztof

maintainer
#2 lore raw
In reply to Jiasheng Jiang
Quoted 6 lines · Jiasheng Jiang

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.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: samsung: idma: Check of ioremap return value

      commit: 3ecb46755eb85456b459a1a9f952c52986bce8ec

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark