]> git.hungrycats.org Git - linux/commit
ALSA: es18xx: check control allocation before private data setup
authorRuoyu Wang <ruoyuw560@gmail.com>
Sun, 7 Jun 2026 07:42:19 +0000 (15:42 +0800)
committerTakashi Iwai <tiwai@suse.de>
Sun, 7 Jun 2026 09:45:03 +0000 (11:45 +0200)
commit422e42b7c2b882ba1d16d4afc8891bcea7c4de93
tree66822a70229e3acb3b36ca8e1f552c9171aa6ef5
parent27ceefc5317e4294c225d67815a79b0415ad0dc6
ALSA: es18xx: check control allocation before private data setup

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 <ruoyuw560@gmail.com>
Link: https://patch.msgid.link/20260607074219.3-1-ruoyuw560@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/es18xx.c