diff options
| author | Quan Sun <2022090917019@std.uestc.edu.cn> | 2026-05-14 21:22:45 +0800 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-05-15 09:09:07 +0200 |
| commit | 9921941929ab014038c357b30567d93d20393a94 (patch) | |
| tree | 3f8997aa0a5344207920f87d8ed9c48307c0fd3b /tools/perf/scripts/python/bin/export-to-sqlite-report | |
| parent | fd87b510f5f543125ecf51e7c706a9f4bc3352be (diff) | |
| download | linux-9921941929ab014038c357b30567d93d20393a94.tar.gz linux-9921941929ab014038c357b30567d93d20393a94.zip | |
ALSA: hda: Fix NULL pointer dereference in snd_hda_ctl_add()
snd_hda_ctl_add() dereferences kctl->id.subdevice without checking
whether kctl is NULL. Multiple callers in sound/hda/codecs/ca0132.c
pass the return value of snd_ctl_new1() directly to snd_hda_ctl_add()
without a NULL check:
return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
snd_ctl_new1() returns NULL when the underlying snd_ctl_new() fails
on memory allocation (kzalloc_flex),which can occur under memory
pressure or via fault injection.
Add a NULL check at the entry of snd_hda_ctl_add(), matching the
pattern already used by snd_ctl_add_replace() at the same call
path (sound/core/control.c:515). Return -EINVAL to let callers
handle the error gracefully.
Fixes: 44f0c9782cc6 ("ALSA: hda/ca0132: Add tuning controls")
Signed-off-by: Quan Sun <2022090917019@std.uestc.edu.cn>
Link: https://patch.msgid.link/20260514132245.3062884-1-2022090917019@std.uestc.edu.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-sqlite-report')
0 files changed, 0 insertions, 0 deletions
