[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <d973fbc962f750ef87c0bccf7b2df6536c8e987f.1505971045.git.arvind.yadav.cs@gmail.com>
Date: Thu, 21 Sep 2017 10:50:03 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: lgirdwood@...il.com, broonie@...nel.org, perex@...ex.cz,
tiwai@...e.com, timur@...i.org, nicoleotsuka@...il.com,
Xiubo.Lee@...il.com, fabio.estevam@....com, peter.ujfalusi@...com,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc: linuxppc-dev@...ts.ozlabs.org, linux-omap@...r.kernel.org
Subject: [PATCH v2 2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.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
Powered by blists - more mailing lists