]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: hda: cs35l56: Fix system name string leaks
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Fri, 22 May 2026 12:49:30 +0000 (09:49 -0300)
committerTakashi Iwai <tiwai@suse.de>
Mon, 25 May 2026 07:22:23 +0000 (09:22 +0200)
commita0d9e8df2ebca290c2efff70abc05426e5a476b0
tree1bcb589330322c88844849a07f8dd4584db9e49e
parentf7b1f71566ff9d5344a516fa745118cee924c8d0
ALSA: hda: cs35l56: Fix system name string leaks

cs35l56_hda_read_acpi() gets an allocated ACPI _SUB string from
acpi_get_subsystem_id(). On success, that string is used to create the
firmware system name.

Several error paths after the _SUB lookup can return without releasing
the allocated string. This includes speaker ID lookup errors other than
-ENOENT, and errors after a firmware system name has been allocated.

Use scoped cleanup for the temporary _SUB string and make
cs35l56->system_name device-managed. This releases the temporary _SUB
string on every error path and lets devres release the firmware system
name on probe failure and device removal.

Fixes: 6f03b446cbae ("ALSA: hda: cs35l56: Add support for speaker id")
Fixes: 40b1c2f9b299 ("ALSA: hda/cs35l56: Workaround bad dev-index on Lenovo Yoga Book 9i GenX")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260522-alsa-cs35l56-system-name-leak-v4-1-a6154dd09cd9@gmail.com
sound/hda/codecs/side-codecs/cs35l56_hda.c