Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/6] ALSA: check snd_ctl_new1() return value in multiple drivers
@ 2026-05-27 12:09 Zhao Dongdong
  2026-05-28  7:37 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Zhao Dongdong @ 2026-05-27 12:09 UTC (permalink / raw)
  To: perex, tiwai; +Cc: linux-sound, Zhao Dongdong

From: Zhao Dongdong <zhaodongdong@kylinos.cn>

Check snd_ctl_new1() return value before dereferencing in:
  - es1938
  - cmipci
  - ymfpci
  - ice1712 (aureon, ice1712, ice1724)
  - gus
  - aoa (layout)

snd_ctl_new1() can return NULL when memory allocation fails.
Add a NULL check and return -ENOMEM on failure.

Assisted-by: Opencode:DeepSeek-V4-Flash
Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
---
v1: https://lore.kernel.org/linux-sound/875x49w1i0.wl-tiwai@suse.de/

---
Zhao Dongdong (6):
  ALSA: es1938: check snd_ctl_new1() return value
  ALSA: gus: check snd_ctl_new1() return value
  ALSA: ice1712: check snd_ctl_new1() return value
  ALSA: ymfpci: check snd_ctl_new1() return value
  ALSA: cmipci: check snd_ctl_new1() return value
  ALSA: aoa: check snd_ctl_new1() return value

 sound/aoa/fabrics/layout.c     | 6 ++++++
 sound/isa/gus/gus_pcm.c        | 2 ++
 sound/pci/cmipci.c             | 6 ++++++
 sound/pci/es1938.c             | 2 ++
 sound/pci/ice1712/aureon.c     | 2 ++
 sound/pci/ice1712/ice1712.c    | 8 ++++++++
 sound/pci/ice1712/ice1724.c    | 6 ++++++
 sound/pci/ymfpci/ymfpci_main.c | 6 ++++++
 8 files changed, 38 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-28  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 12:09 [PATCH v3 0/6] ALSA: check snd_ctl_new1() return value in multiple drivers Zhao Dongdong
2026-05-28  7:37 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox