Skip to content

Commit 10b1a5a

Browse files
Dan Carpentertiwai
authored andcommitted
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: 7b2f3eb ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20220111072232.GG11243@kili Signed-off-by: Takashi Iwai <[email protected]>
1 parent f66229a commit 10b1a5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sound/pci/hda/cs35l41_hda.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i
477477
if (ret)
478478
goto err;
479479
kfree(acpi_hw_cfg);
480+
acpi_hw_cfg = NULL;
480481

481482
if (cs35l41->reg_seq->probe) {
482483
ret = regmap_register_patch(cs35l41->regmap, cs35l41->reg_seq->probe,

0 commit comments

Comments
 (0)