ALSA: hda: cs35l41: Cleanup and fix double free in firmware request
authorStefan Binding <sbinding@opensource.cirrus.com>
Tue, 3 Oct 2023 14:21:38 +0000 (15:21 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Oct 2023 09:11:18 +0000 (11:11 +0200)
commit5d542b850d40cb08a38ad4bb2a944dbf1b7b0683
tree479c7247d1541cb63ad7172704ff0231d3b406cf
parent9c1a3f432b62a2b34f2f58cda0dcf7229e83bf98
ALSA: hda: cs35l41: Cleanup and fix double free in firmware request

There is an unlikely but possible double free when loading firmware,
and a missing free calls if a firmware is successfully requested but
the coefficient file request fails, leading to the fallback firmware
request occurring without clearing the previously loaded firmware.

Fixes: cd40dad2ca91 ("ALSA: hda: cs35l41: Ensure firmware/tuning pairs are always loaded")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202309291331.0JUUQnPT-lkp@intel.com/
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231003142138.180108-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda.c