diff options
author | Stefan Agner <stefan@agner.ch> | 2019-01-18 10:06:52 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-07-09 22:03:48 +0100 |
commit | 469dfbabbd120dad00a31d6fd913660ba8549087 (patch) | |
tree | 46db085e258bce243537f7400f1cc8c482b63736 | |
parent | 7eadb226baa9915d46e40d934e6e0ca788ca15f0 (diff) | |
download | linux-stable-469dfbabbd120dad00a31d6fd913660ba8549087.tar.gz linux-stable-469dfbabbd120dad00a31d6fd913660ba8549087.tar.bz2 linux-stable-469dfbabbd120dad00a31d6fd913660ba8549087.zip |
ASoC: imx-sgtl5000: put of nodes if finding codec fails
commit d9866572486802bc598a3e8576a5231378d190de upstream.
Make sure to properly put the of node in case finding the codec
fails.
Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 1cb22dd034eb..be14200293fc 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c @@ -118,7 +118,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) codec_dev = of_find_i2c_device_by_node(codec_np); if (!codec_dev) { dev_err(&pdev->dev, "failed to find codec platform device\n"); - return -EPROBE_DEFER; + ret = -EPROBE_DEFER; + goto fail; } data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |