Re: [PATCH v2] ALSA: hda: intel: Validate master count before creating link mask
From: Takashi Iwai
Date: Sun Dec 06 2026 - 06:09:36 EST
On Sat, 05 Dec 2026 16:18:40 +0100,
Sreeraj S Kurup wrote:
>
> The driver uses GENMASK(count - 1, 0) to create the link
> mask from the mipi-sdw-master-count ACPI property.
>
> However, the link mask is created before validating the
> master count. If firmware reports a count of zero, the
> unsigned subtraction count - 1 underflows. If the count
> exceeds SDW_INTEL_MAX_LINKS, an invalid link mask may
> be generated.
>
> Move link mask creation after the existing count checks
> to ensure the count is valid before calling GENMASK().
>
> Fixes: 71dce222d586 ("ALSA/hda: intel-sdw-acpi: add support for sdw-manager-list property read")
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@xxxxxxxxx>
Applied to for-next branch. Thanks.
Takashi