From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Denis Arefev <arefev@swemel.ru>, David Rhodes <david.rhodes@cirrus.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Stefan Binding <sbinding@opensource.cirrus.com>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org,
stable@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi()
Date: Thu, 4 Dec 2025 11:00:38 +0000 [thread overview]
Message-ID: <0946e25c-ed51-43c2-ba28-ff9c18178bc6@opensource.cirrus.com> (raw)
In-Reply-To: <20251202101338.11437-1-arefev@swemel.ru>
On 02/12/2025 10:13 am, Denis Arefev wrote:
> The acpi_get_first_physical_node() function can return NULL, in which
> case the get_device() function also returns NULL, but this value is
> then dereferenced without checking,so add a check to prevent a crash.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Arefev <arefev@swemel.ru>
> ---
> sound/hda/codecs/side-codecs/cs35l41_hda.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codecs/side-codecs/cs35l41_hda.c
> index c0f2a3ff77a1..21e00055c0c4 100644
> --- a/sound/hda/codecs/side-codecs/cs35l41_hda.c
> +++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c
> @@ -1901,6 +1901,8 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i
>
> cs35l41->dacpi = adev;
> physdev = get_device(acpi_get_first_physical_node(adev));
> + if (!physdev)
> + return -ENODEV;
>
> sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
> if (IS_ERR(sub))
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
next prev parent reply other threads:[~2025-12-04 11:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 10:13 [PATCH] ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi() Denis Arefev
2025-12-04 11:00 ` Richard Fitzgerald [this message]
2025-12-05 14:13 ` Takashi Iwai
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=0946e25c-ed51-43c2-ba28-ff9c18178bc6@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=arefev@swemel.ru \
--cc=david.rhodes@cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=sbinding@opensource.cirrus.com \
--cc=stable@vger.kernel.org \
--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