Patch "ASoC: samsung: idma: Check of ioremap return value" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: samsung: idma: Check of ioremap return value

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-samsung-idma-check-of-ioremap-return-value.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a13e9612273498af62d51d53a1441826d11a3ad4
Author: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
Date:   Tue Dec 28 11:40:26 2021 +0800

    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@xxxxxxxxxxx>
    Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211228034026.1659385-1-jiasheng@xxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c
index 66bcc2f97544b..c3f1b054e2389 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;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux