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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Herve Codina <herve.codina@xxxxxxxxxxx>

commit e62599902327d27687693f6e5253a5d56583db58 upstream.

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@xxxxxxxxxxxxxxx
Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
Link: https://patch.msgid.link/20240701113038.55144-2-herve.codina@xxxxxxxxxxx
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 sound/soc/fsl/fsl_qmc_audio.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/sound/soc/fsl/fsl_qmc_audio.c
+++ b/sound/soc/fsl/fsl_qmc_audio.c
@@ -604,6 +604,8 @@ static int qmc_audio_dai_parse(struct qm
 
 	qmc_dai->name = devm_kasprintf(qmc_audio->dev, GFP_KERNEL, "%s.%d",
 				       np->parent->name, qmc_dai->id);
+	if (!qmc_dai->name)
+		return -ENOMEM;
 
 	qmc_dai->qmc_chan = devm_qmc_chan_get_byphandle(qmc_audio->dev, np,
 							"fsl,qmc-chan");


Patches currently in stable-queue which might be from herve.codina@xxxxxxxxxxx are

queue-6.10/revert-leds-led-core-fix-refcount-leak-in-of_led_get.patch
queue-6.10/asoc-fsl-fsl_qmc_audio-check-devm_kasprintf-returned-value.patch




[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