Re: [PATCH] ALSA: hda/realtek: add missing error checks in alc269 init/shutdown
From: Takashi Iwai
Date: Wed Jul 29 2026 - 03:45:10 EST
On Wed, 29 Jul 2026 08:38:03 +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 init 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
>
> Also add a missing NULL check for codec->bus->pci in alc269_probe()
> before dereferencing it, consistent with the existing checks in the
> same function.
>
> Signed-off-by: Bob Song <songxiebing@xxxxxxxxxx>
Could you split the NULL check to another patch? Basically it's a
completely different sort of fix from others.
thanks,
Takashi