aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Vehmanen <[email protected]>2020-07-17 13:19:48 +0300
committerMark Brown <[email protected]>2020-07-22 14:31:56 +0100
commit640f835cd052bba403f955db15130ff813be78d2 (patch)
tree395ef18e8a07964b4d7f7e452169a5d98c023082
parent5856d8bd308f9467cefa65d04e184a56a3977559 (diff)
ASoC: hdac_hda: call patch_ops.free() on probe error
Add error handling for patch_ops in hdac_hda_codec_probe(). Signed-off-by: Kai Vehmanen <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/codecs/hdac_hda.c7
1 files changed, 5 insertions, 2 deletions
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: