ASoC: fsl: imx-wm8962: Fix error path
authorFabio Estevam <fabio.estevam@freescale.com>
Thu, 18 Jul 2013 18:07:48 +0000 (15:07 -0300)
committerMark Brown <broonie@linaro.org>
Thu, 18 Jul 2013 20:51:14 +0000 (21:51 +0100)
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>
sound/soc/fsl/imx-wm8962.c

index 52a36a90f4f4eb19c4739fda1714f48e715d1c68..1d70e278e9154e7f21d1ba230b4f573ad5b31f95 100644 (file)
@@ -217,7 +217,8 @@ static int imx_wm8962_probe(struct platform_device *pdev)
        codec_dev = of_find_i2c_device_by_node(codec_np);
        if (!codec_dev || !codec_dev->driver) {
                dev_err(&pdev->dev, "failed to find codec platform device\n");
-               return -EINVAL;
+               ret = -EINVAL;
+               goto fail;
        }
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);