[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220126113307.1673-1-linmq006@gmail.com>
Date: Wed, 26 Jan 2022 11:33:04 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Miaoqian Lin <linmq006@...il.com>,
Eric Millbrandt <emillbrandt@...aresearch.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ASoC: fsl: Add missing error handling in pcm030_fabric_probe
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@...il.com>
---
sound/soc/fsl/pcm030-audio-fabric.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c
index af3c3b90c0ac..02c4ae20c673 100644
--- a/sound/soc/fsl/pcm030-audio-fabric.c
+++ b/sound/soc/fsl/pcm030-audio-fabric.c
@@ -93,15 +93,22 @@ 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);
+ goto exit_device_put;
+ }
ret = snd_soc_register_card(card);
if (ret)
dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret);
platform_set_drvdata(op, pdata);
+ return ret;
+exit_release_dev:
+ platform_device_del(pdata->codec_device);
+exit_device_put:
+ platform_device_put(pdata->codec_device);
return ret;
}
--
2.17.1
Powered by blists - more mailing lists