Centos-kernel-stream-9/sound
Jaroslav Kysela 3aa794640a ALSA: core: Fix double-free at snd_card_new()
During the code change to add the support for devres-managed card
instance, we put an explicit kfree(card) call at the error path in
snd_card_new().  This is needed for the early error path before the
card is initialized with the device, but is rather superfluous and
causes a double-free at the error path after the card instance is
initialized, as the destructor of the card object already contains a
kfree() call.

This patch fixes the double-free situation by removing the superfluous
kfree().  Meanwhile we need to call kfree() explicitly for the early
error path, so it's added there instead.

    Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation")
    Reported-by: Rondreis <linhaoguo86@gmail.com>
    Cc: <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/CAB7eexL1zBnB636hwS27d-LdPYZ_R1-5fJS_h=ZbCWYU=UPWJg@mail.gmail.com
    Link: https://lore.kernel.org/r/20220919123516.28222-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai <tiwai@suse.de>

Author: Takashi Iwai <tiwai@suse.de>
Date: Mon Sep 19 14:35:16 2022 +0200

Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
(cherry picked from commit c3afa2a402d1ecefa59f88d55d9e765f52f75bd9)
Bugzilla: https://bugzilla.redhat.com/2125537
2022-11-03 15:17:16 +01:00
..
ac97 bus: Make remove callback return void 2022-08-25 10:41:31 -06:00
aoa bus: Make remove callback return void 2022-08-25 10:41:31 -06:00
arm
atmel
core ALSA: core: Fix double-free at snd_card_new() 2022-11-03 15:17:16 +01:00
drivers
firewire ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes 2022-05-26 12:31:08 +02:00
hda ALSA: hda: Fix discovery of i915 graphics PCI device 2022-08-03 08:49:49 +02:00
i2c
isa ALSA: wavefront: Proper check of get_user() error 2022-05-26 12:31:09 +02:00
mips ALSA: mips: Use platform_get_irq() to get the interrupt 2022-05-26 12:31:11 +02:00
oss sound/oss/dmasound: fix 'dmasound_setup' defined but not used 2022-05-26 12:31:11 +02:00
parisc
pci ALSA: hda: Once again fix regression of page allocations with IOMMU 2022-11-03 15:17:16 +01:00
pcmcia
ppc ALSA: ppc: beep: fix clang -Wimplicit-fallthrough 2022-05-26 12:31:11 +02:00
sh
soc ASoC: hdmi-codec: Update to modern DAI terminology 2022-10-25 13:19:44 +02:00
sparc ALSA: sparc: no need to initialise statics to 0 2022-05-26 12:31:11 +02:00
spi ALSA: spi: Add check for clk_enable() 2022-05-26 12:31:11 +02:00
synth
usb ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) 2022-08-03 08:49:52 +02:00
virtio virtio: wrap config->reset calls 2022-08-25 10:45:04 -06:00
x86 ALSA: intel_hdmi: Fix the missing snd_card_free() call at probe error 2022-05-26 10:12:51 +02:00
xen
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c sound: core: Remove redundant variable and return the last statement 2022-05-26 12:31:11 +02:00