summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-01-11 08:22:32 +0100
committerTakashi Iwai <tiwai@suse.de>2022-01-11 16:57:24 +0100
commit10b1a5a99c6ac42be7a490676aec626fba28b048 (patch)
tree51d0b4702cdfdc9c59ec548ccbc1dceb26a6259f /sound/pci
parentMerge tag 'asoc-v5.17-2' of https://git.kernel.org/pub/scm/linux/kernel/git/b... (diff)
downloadlinux-10b1a5a99c6ac42be7a490676aec626fba28b048.tar.xz
linux-10b1a5a99c6ac42be7a490676aec626fba28b048.zip
ALSA: hda: cs35l41: fix double free on error in probe()
If we encounter an error after the kfree(acpi_hw_cfg); then the goto err; will result in a double free. Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20220111072232.GG11243@kili Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/cs35l41_hda.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index aa5bb6977792..30b40d865863 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -477,6 +477,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i
if (ret)
goto err;
kfree(acpi_hw_cfg);
+ acpi_hw_cfg = NULL;
if (cs35l41->reg_seq->probe) {
ret = regmap_register_patch(cs35l41->regmap, cs35l41->reg_seq->probe,