Patch "ASoC: pxa: fix null-pointer dereference in filter()" has been added to the 4.19-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: pxa: fix null-pointer dereference in filter()

to the 4.19-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-pxa-fix-null-pointer-dereference-in-filter.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 8cbcbea65196df77b7ee61965c7a28e735e39b02
Author: Zeng Heng <zengheng4@xxxxxxxxxx>
Date:   Mon Nov 14 16:56:29 2022 +0800

    ASoC: pxa: fix null-pointer dereference in filter()
    
    [ Upstream commit ec7bf231aaa1bdbcb69d23bc50c753c80fb22429 ]
    
    kasprintf() would return NULL pointer when kmalloc() fail to allocate.
    Need to check the return pointer before calling strcmp().
    
    Fixes: 7a824e214e25 ("ASoC: mmp: add audio dma support")
    Signed-off-by: Zeng Heng <zengheng4@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221114085629.1910435-1-zengheng4@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c
index d2d4652de32c..5969aa66410d 100644
--- a/sound/soc/pxa/mmp-pcm.c
+++ b/sound/soc/pxa/mmp-pcm.c
@@ -90,7 +90,7 @@ static bool filter(struct dma_chan *chan, void *param)
 
 	devname = kasprintf(GFP_KERNEL, "%s.%d", dma_data->dma_res->name,
 		dma_data->ssp_id);
-	if ((strcmp(dev_name(chan->device->dev), devname) == 0) &&
+	if (devname && (strcmp(dev_name(chan->device->dev), devname) == 0) &&
 		(chan->chan_id == dma_data->dma_res->start)) {
 		found = true;
 	}



[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