aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-07-18 14:07:48 -0400
committerMark Brown <broonie@linaro.org>2013-07-18 16:51:14 -0400
commitd8a14e302ffeecc312186b8b9b0efc8963cec83b (patch)
tree7dff402153b98c7ca9d08c326400605f6ff0d3bf
parent02502da4579ffcd2b96334297ba8e6daefe618c4 (diff)
ASoC: fsl: imx-wm8962: Fix error path
If the 'failed to find codec platform device' error path is executed, it should jump to 'fail' label instead of returning an error immediately. 'fail' label will then free the ssi_np and codec_np previously acquired nodes. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/fsl/imx-wm8962.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c
index 52a36a90f4f4..1d70e278e915 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -217,7 +217,8 @@ static int imx_wm8962_probe(struct platform_device *pdev)
217 codec_dev = of_find_i2c_device_by_node(codec_np); 217 codec_dev = of_find_i2c_device_by_node(codec_np);
218 if (!codec_dev || !codec_dev->driver) { 218 if (!codec_dev || !codec_dev->driver) {
219 dev_err(&pdev->dev, "failed to find codec platform device\n"); 219 dev_err(&pdev->dev, "failed to find codec platform device\n");
220 return -EINVAL; 220 ret = -EINVAL;
221 goto fail;
221 } 222 }
222 223
223 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 224 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);