mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ALSA: hda: cs35l56: fix system name leaks
@ 2026-05-20 14:50 Cássio Gabriel
  2026-05-20 14:50 ` [PATCH v2 1/2] ALSA: hda: cs35l56: Free ACPI _SUB string on errors Cássio Gabriel
  2026-05-20 14:50 ` [PATCH v2 2/2] ALSA: hda: cs35l56: Free system name on probe errors Cássio Gabriel
  0 siblings, 2 replies; 5+ messages in thread
From: Cássio Gabriel @ 2026-05-20 14:50 UTC (permalink / raw)
  To: David Rhodes, Richard Fitzgerald, Takashi Iwai, Jaroslav Kysela,
	Simon Trimmer, Mark Brown
  Cc: linux-sound, patches, linux-kernel, Cássio Gabriel

cs35l56_hda_read_acpi() reads an allocated ACPI _SUB string to build
the firmware system name. Current error paths can return after _SUB has
been allocated, or after it has been transferred to cs35l56->system_name,
without releasing that memory.

Fix the local read_acpi() unwind paths first, then release the stored
system name from the common probe error path.

Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
---
Changes in v2:
- Use __free(kfree) for the temporary ACPI _SUB string.
- Keep the derived system name local until read_acpi() succeeds.
- Transfer ownership with no_free_ptr() only on successful paths.
- Link to v1: https://patch.msgid.link/20260520-alsa-cs35l56-system-name-leak-v1-0-d13b54423198@gmail.com

---
Cássio Gabriel (2):
      ALSA: hda: cs35l56: Free ACPI _SUB string on errors
      ALSA: hda: cs35l56: Free system name on probe errors

 sound/hda/codecs/side-codecs/cs35l56_hda.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
---
base-commit: 38c607c673155d6335591cdbd9c785fb2b7550e5
change-id: 20260501-alsa-cs35l56-system-name-leak-7fd779eac391

Best regards,
--  
Cássio Gabriel <cassiogabrielcontato@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-21 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-20 14:50 [PATCH v2 0/2] ALSA: hda: cs35l56: fix system name leaks Cássio Gabriel
2026-05-20 14:50 ` [PATCH v2 1/2] ALSA: hda: cs35l56: Free ACPI _SUB string on errors Cássio Gabriel
2026-05-21 12:14   ` Richard Fitzgerald
2026-05-21 12:48     ` Cássio Gabriel Monteiro Pires
2026-05-20 14:50 ` [PATCH v2 2/2] ALSA: hda: cs35l56: Free system name on probe errors Cássio Gabriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®