Re: [PATCH v2] ALSA: hda/realtek: add missing error checks for COEF index reads in alc269
From: Takashi Iwai
Date: Thu Jul 30 2026 - 06:05:14 EST
On Thu, 30 Jul 2026 03:53:01 +0200,
songxiebing wrote:
>
> From: Bob Song <songxiebing@xxxxxxxxxx>
>
> alc_read_coef_idx() and alc_read_coefex_idx() can return -1 on error
> via snd_hda_codec_read(). Several codec initialization and shutdown
> functions save these return values and later write them back to
> hardware registers without checking for errors, potentially corrupting
> COEF register state on a read failure.
>
> Add error checks in:
> - alc282_init() and alc282_shutup(): check coef78 before write-back
> - alc285_hp_init(): check coef38/coef0d/coef36 before update, check
> val before write-back, and break polling loop on error
> - alc294_hp_init(): break polling loop on read error
>
> Signed-off-by: Bob Song <songxiebing@xxxxxxxxxx>
> ---
> v2:
> - Separate processing of return values from reading COEF and
> null pointer detection for device.
Applied to for-next branch. Thanks.
Takashi