Skip to contentSkip to conversation

ASoC: fsl: imx-wm8962: Fix error path

PATCH Applied Fabio Estevam 2 participants 2 messages Jul 18, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 sound/soc/fsl/imx-wm8962.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/fsl/imx-wm8962.c +2 -1
index 52a36a9..1d70e27 100644
@@ -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);
Signature · 1 line
1.8.1.2
maintainer Applied
#1 lore raw
Quoted 4 lines · Fabio Estevam

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.

Applied, thanks.