linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: samsung: idma: Check of ioremap return value
@ 2021-12-28  3:40 Jiasheng Jiang
  2021-12-28 13:12 ` Krzysztof Kozlowski
  2021-12-29 13:29 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jiasheng Jiang @ 2021-12-28  3:40 UTC (permalink / raw)
  To: krzysztof.kozlowski, s.nawrocki, lgirdwood, broonie, perex, tiwai
  Cc: alsa-devel, linux-kernel, 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")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 sound/soc/samsung/idma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c
index 66bcc2f97544..c3f1b054e238 100644
--- a/sound/soc/samsung/idma.c
+++ b/sound/soc/samsung/idma.c
@@ -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;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: samsung: idma: Check of ioremap return value
  2021-12-28  3:40 [PATCH] ASoC: samsung: idma: Check of ioremap return value Jiasheng Jiang
@ 2021-12-28 13:12 ` Krzysztof Kozlowski
  2021-12-29 13:29 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-12-28 13:12 UTC (permalink / raw)
  To: Jiasheng Jiang, s.nawrocki, lgirdwood, broonie, perex, tiwai
  Cc: alsa-devel, linux-kernel

On 28/12/2021 04:40, Jiasheng Jiang wrote:
> 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>
> ---
>  sound/soc/samsung/idma.c | 2 ++
>  1 file changed, 2 insertions(+)
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: samsung: idma: Check of ioremap return value
  2021-12-28  3:40 [PATCH] ASoC: samsung: idma: Check of ioremap return value Jiasheng Jiang
  2021-12-28 13:12 ` Krzysztof Kozlowski
@ 2021-12-29 13:29 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-12-29 13:29 UTC (permalink / raw)
  To: lgirdwood, tiwai, krzysztof.kozlowski, s.nawrocki, perex, Jiasheng Jiang
  Cc: linux-kernel, alsa-devel

On Tue, 28 Dec 2021 11:40:26 +0800, Jiasheng Jiang wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-29 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28  3:40 [PATCH] ASoC: samsung: idma: Check of ioremap return value Jiasheng Jiang
2021-12-28 13:12 ` Krzysztof Kozlowski
2021-12-29 13:29 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).