From: Takashi Iwai <tiwai@suse.de>
To: songxiebing <songxiebing@kylinos.cn>
Cc: tiwai@suse.com, perex@perex.cz, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda/realtek: add missing error checks in alc269 init/shutdown
Date: Wed, 29 Jul 2026 09:35:03 +0200 [thread overview]
Message-ID: <87ecgm5jvc.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260729063803.1453980-1-songxiebing@kylinos.cn>
On Wed, 29 Jul 2026 08:38:03 +0200,
songxiebing wrote:
>
> From: Bob Song <songxiebing@kylinos.cn>
>
> 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@kylinos.cn>
Could you split the NULL check to another patch? Basically it's a
completely different sort of fix from others.
thanks,
Takashi
prev parent reply other threads:[~2026-07-29 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 6:38 [PATCH] ALSA: hda/realtek: add missing error checks in alc269 init/shutdown songxiebing
2026-07-29 7:35 ` Takashi Iwai [this message]
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=87ecgm5jvc.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=songxiebing@kylinos.cn \
--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