]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Remove WARN_ON() at snd_pcm_hw_params() error
authorTakashi Iwai <tiwai@suse.de>
Mon, 9 Apr 2018 15:12:16 +0000 (17:12 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 Apr 2018 15:39:31 +0000 (17:39 +0200)
commit32326c52c00f3257e914ab3c618c3f4090b59fa2
tree75652f896153b41f9825d14b8725c752070421fd
parentfb77320f4f29e18088443b4512b39e814eb95bb5
ALSA: pcm: Remove WARN_ON() at snd_pcm_hw_params() error

snd_pcm_hw_params() (more exactly snd_pcm_hw_params_choose()) contains
a check of the return error from snd_pcm_hw_param_first() and _last()
with snd_BUG_ON() -- i.e. it may trigger WARN_ON() depending on the
kconfig.

This was a valid check in the past, as these functions shouldn't
return any error if the parameters have been already refined via
snd_pcm_hw_refine() beforehand.  However, the recent rewrite
introduced a kmalloc() in snd_pcm_hw_refine() for removing VLA, and
this brought a possibility to trigger an error.  As a result, syzbot
caught lots of superfluous kernel WARN_ON() and paniced via fault
injection.

As the WARN_ON() is no longer valid with the introduction of
kmalloc(), let's drop snd_BUG_ON() check, in order to make the world
peaceful place again.

Reported-by: syzbot+803e0047ac3a3096bb4f@syzkaller.appspotmail.com
Fixes: d6a5c5e1a948 ("ALSA: pcm: Remove VLA usage")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c