ALSA: hda - Serialize codec registrations
authorTakashi Iwai <tiwai@suse.de>
Wed, 30 Jan 2019 16:46:03 +0000 (17:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:11 +0000 (19:46 +0100)
commitc201e435e15f3595e508f630644ed0424cfc6666
tree73e321b0d801c834d02c70a2a7fa4c1613f7b007
parentbbc0621ff3ed26b06769345a75c1802d53822efb
ALSA: hda - Serialize codec registrations

commit 305a0ade180981686eec1f92aa6252a7c6ebb1cf upstream.

In the current code, the codec registration may happen both at the
codec bind time and the end of the controller probe time.  In a rare
occasion, they race with each other, leading to Oops due to the still
uninitialized card device.

This patch introduces a simple flag to prevent the codec registration
at the codec bind time as long as the controller probe is going on.
The controller probe invokes snd_card_register() that does the whole
registration task, and we don't need to register each piece
beforehand.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/hda_bind.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_intel.c