Skip to content

Commit e038f43

Browse files
Charles Hanbroonie
authored andcommitted
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: 05d996e ("ASoC: imx-audmix: Split capture device for audmix") Signed-off-by: Charles Han <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0109ee0 commit e038f43

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/soc/fsl/imx-audmix.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ static int imx_audmix_probe(struct platform_device *pdev)
274274
/* Add AUDMIX Backend */
275275
be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
276276
"audmix-%d", i);
277+
if (!be_name)
278+
return -ENOMEM;
279+
277280
priv->dai[num_dai + i].cpus = &dlc[1];
278281
priv->dai[num_dai + i].codecs = &snd_soc_dummy_dlc;
279282

0 commit comments

Comments
 (0)