diff mbox series

[2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf

Message ID 1505901971-12004-3-git-send-email-arvind.yadav.cs@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series ASoC: Handle return value of devm_kasprintf | expand

Commit Message

Arvind Yadav Sept. 20, 2017, 10:06 a.m. UTC
devm_kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 2db4d0c..86f240b 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -639,6 +639,8 @@  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)
+			goto asrc_fail;
 	}
 
 	priv->dai_link[0].platform_of_node = cpu_np;