Patch "ASoC: qcom: Add checks for devm_kcalloc" has been added to the 5.10-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: qcom: Add checks for devm_kcalloc

to the 5.10-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-qcom-add-checks-for-devm_kcalloc.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 8a7e97f20ea03d50c7678e48d8827503787f44ad
Author: Yuan Can <yuancan@xxxxxxxxxx>
Date:   Thu Nov 24 14:05:10 2022 +0000

    ASoC: qcom: Add checks for devm_kcalloc
    
    [ Upstream commit 1bf5ee979076ceb121ee51c95197d890b1cee7f4 ]
    
    As the devm_kcalloc may return NULL, the return value needs to be checked
    to avoid NULL poineter dereference.
    
    Fixes: 24caf8d9eb10 ("ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio")
    Signed-off-by: Yuan Can <yuancan@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221124140510.63468-1-yuancan@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c
index c647e627897a..cb4e9017cd77 100644
--- a/sound/soc/qcom/lpass-sc7180.c
+++ b/sound/soc/qcom/lpass-sc7180.c
@@ -129,6 +129,9 @@ static int sc7180_lpass_init(struct platform_device *pdev)
 
 	drvdata->clks = devm_kcalloc(dev, variant->num_clks,
 				     sizeof(*drvdata->clks), GFP_KERNEL);
+	if (!drvdata->clks)
+		return -ENOMEM;
+
 	drvdata->num_clks = variant->num_clks;
 
 	for (i = 0; i < drvdata->num_clks; i++)



[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