Re: [PATCH] ALSA: cs46xx: Handle SCB creation failures before dereferencing

From: Takashi Iwai

Date: Sat Oct 31 2026 - 12:10:54 EST


On Fri, 30 Oct 2026 15:25:27 +0100,
Alex Kazinsky wrote:
>
> With CONFIG_PM_SLEEP enabled, cs46xx_dsp_create_scb() can return NULL
> if kmemdup() fails to allocate the SCB data saved for resume.
> cs46xx_dsp_scb_and_task_init() and _dsp_create_generic_scb() dereference
> the returned pointer without checking it, causing a NULL pointer
> dereference on allocation failure.
>
> Check both return values before accessing the SCB descriptors.
> Return -ENOMEM when creating the null SCB fails and propagate NULL
> from _dsp_create_generic_scb().
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE
> static analysis tool.
>
> Fixes: 41116e926cb9 ("ALSA: cs46xx - Fix suspend/resume with new DSP")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Alex Kazinsky <a.kazinsky@xxxxxxxx>

Applied now. Thanks.


Takashi