ALSA: pcm: Don't treat NULL chmap as a fatal error
authorTakashi Iwai <tiwai@suse.de>
Wed, 14 Jun 2017 14:20:32 +0000 (16:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2017 11:00:28 +0000 (13:00 +0200)
commit552a14a572a21cac91d190b38ac1a8aba9730f35
treecd7e2a637258f456711893000383b416ac23ea3a
parent8c9c55a0f5764337ff4429ae6e15c3b6a45d1124
ALSA: pcm: Don't treat NULL chmap as a fatal error

commit 2deaeaf102d692cb6f764123b1df7aa118a8e97c upstream.

The standard PCM chmap helper callbacks treat the NULL info->chmap as
a fatal error and spews the kernel warning with stack trace when
CONFIG_SND_DEBUG is on.  This was OK, originally it was supposed to be
always static and non-NULL.  But, as the recent addition of Intel LPE
audio driver shows, the chmap content may vary dynamically, and it can
be even NULL when disconnected.  The user still sees the kernel
warning unnecessarily.

For clearing such a confusion, this patch simply removes the
snd_BUG_ON() in each place, just returns an error without warning.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm_lib.c