linux-stable/include
Takashi Iwai d0f475336f ALSA: core: Add snd_card_free_on_error() helper
commit fee2b871d8 upstream.

This is a small helper function to handle the error path more easily
when an error happens during the probe for the device with the
device-managed card.  Since devres releases in the reverser order of
the creations, usually snd_card_free() gets called at the last in the
probe error path unless it already reached snd_card_register() calls.
Due to this nature, when a driver expects the resource releases in
card->private_free, this might be called too lately.

As a workaround, one should call the probe like:

 static int __some_probe(...) { // do real probe.... }

 static int some_probe(...)
 {
	return snd_card_free_on_error(dev, __some_probe(dev, ...));
 }

so that the snd_card_free() is called explicitly at the beginning of
the error path from the probe.

This function will be used in the upcoming fixes to address the
regressions by devres usages.

Fixes: e8ad415b7a ("ALSA: core: Add managed card creation")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220412093141.8008-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:36:07 +02:00
..
acpi
asm-generic bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
clocksource
crypto lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI 2022-02-04 19:22:32 +01:00
drm drm/connector: Fix typo in documentation 2022-04-08 13:58:58 +02:00
dt-bindings Fixes for omaps 2022-02-07 17:42:44 +01:00
keys
kunit kunit: replace kernel.h with the necessary inclusions 2022-01-20 08:52:54 +02:00
kvm RISCV: 2022-01-16 16:15:14 +02:00
linux static_call: Don't make __static_call_return0 static 2022-04-13 19:27:43 +02:00
math-emu
media
memory
misc
net mctp: Use output netdev to allocate skb headroom 2022-04-13 19:27:29 +02:00
pcmcia
ras
rdma
scsi scsi: core: sd: Add silence_suspend flag to suppress some PM messages 2022-04-08 13:57:20 +02:00
soc soc: fsl: Replace kernel.h with the necessary inclusions 2022-02-18 17:11:17 -06:00
sound ALSA: core: Add snd_card_free_on_error() helper 2022-04-20 09:36:07 +02:00
target
trace SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() 2022-04-13 19:27:40 +02:00
uapi uapi/linux/stddef.h: Add include guards 2022-04-20 09:36:07 +02:00
vdso
video
xen xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-07 09:48:55 +01:00