linux-stable/include
Takashi Iwai dc82e52492 ALSA: core: Assure control device to be registered at last
The commit 289ca025ee ("ALSA: Use priority list for managing device
list") changed the way to register/disconnect/free devices via a
single priority list.  This helped to make behavior consistent, but it
also changed a slight behavior change: namely, the control device is
registered earlier than others, while it was supposed to be the very
last one.

I've put SNDRV_DEV_CONTROL in the current position as the release of
ctl elements often conflict with the private ctl elements some PCM or
other components may create, which often leads to a double-free.
But, the order of register and disconnect should be indeed fixed as
expected in the early days: the control device gets registered at
last, and disconnected at first.

This patch changes the priority list order to move SNDRV_DEV_CONTROL
as the last guy to assure the register / disconnect order.  Meanwhile,
for keeping the messy resource release order, manually treat the
control and lowlevel devices as last freed one.

Additional note:
The lowlevel device is the device where a card driver creates at
probe.  And, we still keep the release order control -> lowlevel, as
there might  be link from a control element back to a lowlevel object.

Fixes: 289ca025ee ("ALSA: Use priority list for managing device list")
Reported-by: Tzung-Bi Shih <tzungbi@google.com>
Tested-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-17 08:21:23 +02:00
..
acpi xen: fixes for 4.17-rc1 2018-04-12 11:04:35 -07:00
asm-generic asm-generic fixes for v4.17-rc1 2018-04-12 09:15:48 -07:00
clocksource ARM: SoC platform updates for 4.17 2018-04-05 21:21:08 -07:00
crypto
drm drm: Fix HDCP downstream dev count read 2018-04-16 12:10:48 -04:00
dt-bindings The large diff this time around is from the addition of a new clk driver 2018-04-13 15:51:06 -07:00
keys
kvm
linux ALSA: usb-audio: UAC3 Add support for connector insertion. 2018-05-15 07:35:34 +02:00
math-emu
media media updates for v4.17-rc1 2018-04-10 10:10:30 -07:00
memory
misc
net slip: Check if rstate is initialized before uncompressing 2018-04-11 10:33:46 -04:00
pcmcia
ras
rdma Merge candidates for 4.17 merge window 2018-04-06 17:35:43 -07:00
scsi SCSI for-linus on 20180404 2018-04-05 15:05:53 -07:00
soc ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
sound ALSA: core: Assure control device to be registered at last 2018-05-17 08:21:23 +02:00
target
trace NFS client updates for Linux 4.17 2018-04-12 12:55:50 -07:00
uapi ALSA: usb-audio: UAC3. Add support for mixer unit. 2018-05-15 07:32:50 +02:00
video
xen xen/sndif: Sync up with the canonical definition in Xen 2018-04-17 08:26:33 -04:00