Re: [PATCH v2] ALSA: es18xx: check control allocation before private data setup

Takashi Iwai <[email protected]> Sun, 07 Jun 2026 11:45:28 +0200
Newsgroups org.alsa-project.alsa-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound
Message-ID <[email protected]>
On Sun, 07 Jun 2026 09:42:19 +0200,
Ruoyu Wang wrote:
> 
> snd_es18xx_mixer() creates controls with snd_ctl_new1() and then stores
> bookkeeping pointers or sets private_free before calling snd_ctl_add().
> snd_ctl_new1() can return NULL on allocation failure, so those writes
> can dereference a NULL control pointer.
> 
> Check the returned control pointers before using them and return -ENOMEM
> on allocation failure.
> 
> Signed-off-by: Ruoyu Wang <[email protected]>
> ---
> v2:
> - Rebase on sound.git for-next.
> - Resend only es18xx; the other v1 patches are already in for-next.

Applied to for-next branch now.  Thanks.


Takashi