Re: [PATCH] ALSA: hda: cs35l56: Fix uninitialized value in cs35l56_hda_read_acpi()
From: Takashi Iwai
Date: Wed Apr 29 2026 - 01:50:48 EST
On Tue, 28 Apr 2026 15:05:31 +0200,
Richard Fitzgerald wrote:
>
> Eliminate the uninitialized 'nval' in cs35l56_hda_read_acpi() if a
> system-specific quirk overrides processing of the dev-index property.
> The value is now stored in a new 'num_amps' member of struct cs35l56_hda
> so that the quirk handler can set the value.
>
> The quirk for the Lenovo Yoga Book 9i GenX replaces the values from the
> dev-index property with hardcoded indexes. So cs35l56_hda_read_acpi() would
> then skip reading the property. But this left the 'nval' local variable
> uninitialized when it is later passed to cirrus_scodec_get_speaker_id().
>
> Fixes: 40b1c2f9b299 ("ALSA: hda/cs35l56: Workaround bad dev-index on Lenovo Yoga Book 9i GenX")
> Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> Closes: https://lore.kernel.org/linux-sound/aenFesLAStjrVNy8@stanley.mountain/T/#u
> Signed-off-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>
Applied now. Thanks.
Takashi