Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH v2 2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf
@ 2017-09-21  5:20 Arvind Yadav
  2017-09-21 15:18 ` Mark Brown
  2017-09-21 15:55 ` Applied "ASoC: fsl-asoc-card: Handle return value of devm_kasprintf" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-09-21  5:20 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, timur, nicoleotsuka, Xiubo.Lee,
	fabio.estevam, peter.ujfalusi, alsa-devel, linux-kernel
  Cc: linuxppc-dev, linux-omap

devm_kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2:
               Set return 'ret' to -ENOMEM.

 sound/soc/fsl/fsl-asoc-card.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 2db4d0c..a389885 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -639,6 +639,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 				devm_kasprintf(&pdev->dev, GFP_KERNEL,
 					       "ac97-codec.%u",
 					       (unsigned int)idx);
+		if (!priv->dai_link[0].codec_name) {
+			ret = -ENOMEM;
+			goto asrc_fail;
+		}
 	}
 
 	priv->dai_link[0].platform_of_node = cpu_np;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-21 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-21  5:20 [PATCH v2 2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf Arvind Yadav
2017-09-21 15:18 ` Mark Brown
2017-09-21 15:55 ` Applied "ASoC: fsl-asoc-card: Handle return value of devm_kasprintf" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox