]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: aoa: check snd_ctl_new1() return value
authorZhao Dongdong <zhaodongdong@kylinos.cn>
Wed, 27 May 2026 12:09:14 +0000 (20:09 +0800)
committerTakashi Iwai <tiwai@suse.de>
Thu, 28 May 2026 07:36:43 +0000 (09:36 +0200)
commit8df560fefe6fed6a20b7e06720eeaeccec349ac0
tree66c156503bb46ada1fcbf26a8798669e9eba9090
parentc205bd1b28fb7e5f1061a4e78813fad7d315cb3e
ALSA: aoa: check snd_ctl_new1() return value

snd_ctl_new1() can return NULL when memory allocation fails. In
layout.c, the function does not check the return value before
dereferencing ctl->id.name or passing to aoa_snd_ctl_add(), which can
lead to a NULL pointer dereference.

Add NULL checks after snd_ctl_new1() calls and return early if any
fails.

Assisted-by: Opencode:DeepSeek-V4-Flash
Cc: stable@vger.kernel.org
Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
Link: https://patch.msgid.link/tencent_35F3A25FEEBF190A2E15ED787754C57E3708@qq.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/aoa/fabrics/layout.c