diff mbox series

[1/3] ASoC: hdac_hda: call patch_ops.free() on probe error

Message ID 20200717101950.3885187-1-kai.vehmanen@linux.intel.com (mailing list archive)
State Accepted
Commit 640f835cd052bba403f955db15130ff813be78d2
Headers show
Series [1/3] ASoC: hdac_hda: call patch_ops.free() on probe error | expand

Commit Message

Kai Vehmanen July 17, 2020, 10:19 a.m. UTC
Add error handling for patch_ops in hdac_hda_codec_probe().

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/codecs/hdac_hda.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Mark Brown July 22, 2020, 1:44 p.m. UTC | #1
On Fri, 17 Jul 2020 13:19:48 +0300, Kai Vehmanen wrote:
> Add error handling for patch_ops in hdac_hda_codec_probe().

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: hdac_hda: call patch_ops.free() on probe error
      commit: 640f835cd052bba403f955db15130ff813be78d2
[2/3] ASoC: hdac_hda: fix memleak on module unload
      commit: c3ec8ac82105e9589dcd72636b6fd114db690d55
[3/3] ASoC: hdac_hda: fix deadlock after PCM open error
      commit: 06f07e2365378d51eddd0b5bf23506e1237662b0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c
index 473efe9ef998..72bd779bf942 100644
--- a/sound/soc/codecs/hdac_hda.c
+++ b/sound/soc/codecs/hdac_hda.c
@@ -467,7 +467,7 @@  static int hdac_hda_codec_probe(struct snd_soc_component *component)
 	ret = snd_hda_codec_parse_pcms(hcodec);
 	if (ret < 0) {
 		dev_err(&hdev->dev, "unable to map pcms to dai %d\n", ret);
-		goto error_regmap;
+		goto error_patch;
 	}
 
 	/* HDMI controls need to be created in machine drivers */
@@ -476,7 +476,7 @@  static int hdac_hda_codec_probe(struct snd_soc_component *component)
 		if (ret < 0) {
 			dev_err(&hdev->dev, "unable to create controls %d\n",
 				ret);
-			goto error_regmap;
+			goto error_patch;
 		}
 	}
 
@@ -496,6 +496,9 @@  static int hdac_hda_codec_probe(struct snd_soc_component *component)
 
 	return 0;
 
+error_patch:
+	if (hcodec->patch_ops.free)
+		hcodec->patch_ops.free(hcodec);
 error_regmap:
 	snd_hdac_regmap_exit(hdev);
 error_pm: