Skip to content

Commit

Permalink
ALSA: hda: cs35l41: fix double free on error in probe()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Dan Carpenter authored and tiwai committed Jan 11, 2022
1 parent f66229a commit 10b1a5a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/pci/hda/cs35l41_hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 10b1a5a

Please sign in to comment.