Commit 10b1a5a9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai

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: 7b2f3eb4 ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220111072232.GG11243@kiliSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f66229aa
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment