Patch "ASoC: acp: check the return value of devm_kzalloc() in acp_legacy_dai_links_create()" has been added to the 5.17-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: acp: check the return value of devm_kzalloc() in acp_legacy_dai_links_create()

to the 5.17-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-acp-check-the-return-value-of-devm_kzalloc-in-a.patch
and it can be found in the queue-5.17 subdirectory.

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



commit f71c419b06796674f4ed3c6b68d0feb4d06972f2
Author: Jia-Ju Bai <baijiaju1990@xxxxxxxxx>
Date:   Fri Feb 25 05:16:45 2022 -0800

    ASoC: acp: check the return value of devm_kzalloc() in acp_legacy_dai_links_create()
    
    [ Upstream commit 431f9a77a4a62694ce90742d1f4c5abe1b8b6612 ]
    
    The function devm_kzalloc() in acp_legacy_dai_links_create() can fail,
    so its return value should be checked.
    
    Fixes: d4c750f2c7d4 ("ASoC: amd: acp: Add generic machine driver support for ACP cards")
    Reported-by: TOTE Robot <oslab@xxxxxxxxxxxxxxx>
    Signed-off-by: Jia-Ju Bai <baijiaju1990@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220225131645.27556-1-baijiaju1990@xxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index cd05ee2802c9..5247015e8b31 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -556,6 +556,8 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
 		num_links++;
 
 	links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_links, GFP_KERNEL);
+	if (!links)
+		return -ENOMEM;
 
 	if (drv_data->hs_cpu_id == I2S_SP) {
 		links[i].name = "acp-headset-codec";



[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