Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned value

devm_kasprintf() can return a NULL pointer on failure but this returned
value is not checked.

Fix this lack and check the returned value.

Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-2-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Herve Codina and committed by
Mark Brown
e6259990 e15cc906

+2
+2
sound/soc/fsl/fsl_qmc_audio.c
··· 604 604 605 605 qmc_dai->name = devm_kasprintf(qmc_audio->dev, GFP_KERNEL, "%s.%d", 606 606 np->parent->name, qmc_dai->id); 607 + if (!qmc_dai->name) 608 + return -ENOMEM; 607 609 608 610 qmc_dai->qmc_chan = devm_qmc_chan_get_byphandle(qmc_audio->dev, np, 609 611 "fsl,qmc-chan");