]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: core: Warn on empty module
authorTakashi Iwai <tiwai@suse.de>
Wed, 24 Jun 2020 16:03:00 +0000 (18:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 25 Jun 2020 13:01:35 +0000 (15:01 +0200)
commite40cc84cb9336aed949007e160f2b4be81be0899
treefd63e03ce87c140e5479087c799063834e4a818a
parent0f6d214df0b69e57686e199c41f393c0031d5c4f
ALSA: core: Warn on empty module

The module argument passed to snd_card_new() must be a valid non-NULL
pointer when the module support is enabled.  Since ASoC driver passes
the argument from each snd_soc_card definition, one may forget to set
the owner field and lead to a NULL module easily.

For catching such an overlook, add a WARN_ON() in snd_card_new().
Also, put the card->module assignment in the ifdef block for a very
minor optimization.

Link: https://lore.kernel.org/r/20200624160300.21703-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/init.c