summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-10-08 16:31:18 +0200
committerMark Brown <broonie@kernel.org>2014-10-08 16:42:33 +0200
commita66ae631a3cffb00f441b229a07fa1b4c72e738a (patch)
tree023dc30955c3702f7f306366413f6cf389b9446b /sound/soc
parentMerge remote-tracking branches 'asoc/topic/txx9', 'asoc/topic/wm8978' and 'as... (diff)
downloadlinux-a66ae631a3cffb00f441b229a07fa1b4c72e738a.tar.xz
linux-a66ae631a3cffb00f441b229a07fa1b4c72e738a.zip
ASoC: mc13783: Ensure we only try to dereference valid of_nodes
Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/mc13783.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 388f90a597fa..71f775aad7c7 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -765,12 +765,18 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
return -ENOSYS;
ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port);
- if (ret)
- goto out;
+ if (ret) {
+ of_node_put(np);
+ return ret;
+ }
ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port);
- if (ret)
- goto out;
+ if (ret) {
+ of_node_put(np);
+ return ret;
+ }
+
+ of_node_put(np);
}
dev_set_drvdata(&pdev->dev, priv);
@@ -783,8 +789,6 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783,
mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async));
-out:
- of_node_put(np);
return ret;
}