diff options
author | Charles Han <hanchunchao@inspur.com> | 2024-11-18 16:45:53 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-11-21 14:03:17 +0000 |
commit | e038f43edaf0083f6aa7c9415d86cf28dfd152f9 (patch) | |
tree | 940a99606bfc9e5ac96cd5c0f9b9e84c9b2f2455 /sound | |
parent | 0109ee00788e0ad7b888a799c26b5a93b343876b (diff) | |
download | linux-e038f43edaf0083f6aa7c9415d86cf28dfd152f9.tar.gz linux-e038f43edaf0083f6aa7c9415d86cf28dfd152f9.tar.bz2 linux-e038f43edaf0083f6aa7c9415d86cf28dfd152f9.zip |
ASoC: imx-audmix: Add NULL check in imx_audmix_probe
devm_kasprintf() can return a NULL pointer on failure,but this
returned value in imx_audmix_probe() is not checked.
Add NULL check in imx_audmix_probe(), to handle kernel NULL
pointer dereference error.
Fixes: 05d996e11348 ("ASoC: imx-audmix: Split capture device for audmix")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Link: https://patch.msgid.link/20241118084553.4195-1-hanchunchao@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/imx-audmix.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index dcf770b55c4b..231400661c90 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -274,6 +274,9 @@ static int imx_audmix_probe(struct platform_device *pdev) /* Add AUDMIX Backend */ be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "audmix-%d", i); + if (!be_name) + return -ENOMEM; + priv->dai[num_dai + i].cpus = &dlc[1]; priv->dai[num_dai + i].codecs = &snd_soc_dummy_dlc; |