summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-01-27 13:13:34 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-08 18:23:17 +0100
commit83fd4c6b9383e8c0bd1134dc89a3edc4b66d9c89 (patch)
treebcb096d120b83ab4ad762f0b6e62c45bdbe51c2a /sound
parentd1a0f34c91e719387aff293e9e692ff87c69bf22 (diff)
downloadlinux-stable-83fd4c6b9383e8c0bd1134dc89a3edc4b66d9c89.tar.gz
linux-stable-83fd4c6b9383e8c0bd1134dc89a3edc4b66d9c89.tar.bz2
linux-stable-83fd4c6b9383e8c0bd1134dc89a3edc4b66d9c89.zip
ASoC: fsl: Add missing error handling in pcm030_fabric_probe
commit fb25621da5702c104ce0a48de5b174ced09e5b4e upstream. Add the missing platform_device_put() and platform_device_del() before return from pcm030_fabric_probe in the error handling case. Fixes: c912fa913446 ("ASoC: fsl: register the wm9712-codec") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220127131336.30214-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/pcm030-audio-fabric.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c
index ec731223cab3..72d454899484 100644
--- a/sound/soc/fsl/pcm030-audio-fabric.c
+++ b/sound/soc/fsl/pcm030-audio-fabric.c
@@ -90,16 +90,21 @@ static int pcm030_fabric_probe(struct platform_device *op)
dev_err(&op->dev, "platform_device_alloc() failed\n");
ret = platform_device_add(pdata->codec_device);
- if (ret)
+ if (ret) {
dev_err(&op->dev, "platform_device_add() failed: %d\n", ret);
+ platform_device_put(pdata->codec_device);
+ }
ret = snd_soc_register_card(card);
- if (ret)
+ if (ret) {
dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret);
+ platform_device_del(pdata->codec_device);
+ platform_device_put(pdata->codec_device);
+ }
platform_set_drvdata(op, pdata);
-
return ret;
+
}
static int pcm030_fabric_remove(struct platform_device *op)