mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: "Cássio Gabriel" <cassiogabrielcontato@gmail.com>,
	"David Rhodes" <david.rhodes@cirrus.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Simon Trimmer" <simont@opensource.cirrus.com>,
	"Mark Brown" <broonie@kernel.org>
Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ALSA: hda: cs35l56: Free ACPI _SUB string on errors
Date: Wed, 20 May 2026 13:52:32 +0100	[thread overview]
Message-ID: <9f48fe53-1a69-4445-ba64-13a43e8647aa@opensource.cirrus.com> (raw)
In-Reply-To: <20260520-alsa-cs35l56-system-name-leak-v1-1-d13b54423198@gmail.com>

On 20/05/2026 1:48 pm, Cássio Gabriel wrote:
> cs35l56_hda_read_acpi() gets an allocated ACPI _SUB string from
> acpi_get_subsystem_id(). On success, that string is either transferred
> to cs35l56->system_name or freed after constructing a speaker-ID-specific
> firmware name.
> 
> Several error paths after the _SUB lookup return without releasing the
> allocated string. This includes speaker ID lookup errors other than
> -ENOENT, and errors after _SUB is read but before ownership is
> transferred to cs35l56->system_name.
> 
> Free the temporary _SUB string on those error paths. If ownership has
> already been transferred to cs35l56->system_name, free that member and
> clear it before returning the error.
> 
> 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>
> ---

__free(kfree) would be simpler.


  reply	other threads:[~2026-05-20 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 12:47 [PATCH 0/2] ALSA: hda: cs35l56: fix system name leaks Cássio Gabriel
2026-05-20 12:48 ` [PATCH 1/2] ALSA: hda: cs35l56: Free ACPI _SUB string on errors Cássio Gabriel
2026-05-20 12:52   ` Richard Fitzgerald [this message]
2026-05-20 13:19     ` Cássio Gabriel Monteiro Pires
2026-05-20 12:48 ` [PATCH 2/2] ALSA: hda: cs35l56: Free system name on probe errors Cássio Gabriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f48fe53-1a69-4445-ba64-13a43e8647aa@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=cassiogabrielcontato@gmail.com \
    --cc=david.rhodes@cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=simont@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®