linux/sound/pci
Richard Fitzgerald d344873c4c ALSA: hda: cs35l56: Fix lifetime of cs_dsp instance
The cs_dsp instance is initialized in the driver probe() so it
should be freed in the driver remove(). Also fix a missing call
to cs_dsp_remove() in the error path of cs35l56_hda_common_probe().

The call to cs_dsp_remove() was being done in the component unbind
callback cs35l56_hda_unbind(). This meant that if the driver was
unbound and then re-bound it would be using an uninitialized cs_dsp
instance.

It is best to initialize the cs_dsp instance in probe() so that it
can return an error if it fails. The component binding API doesn't
have any error handling so there's no way to handle a failure if
cs_dsp was initialized in the bind.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 73cfbfa9ca ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
Link: https://lore.kernel.org/r/20240508100811.49514-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-05-08 18:18:29 +02:00
..
ac97 ALSA: ac97: More cleanup with snd_ctl_find_id_mixer() 2024-03-04 09:22:51 +01:00
ali5451 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
asihpi ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
au88x0 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
aw2 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
ca0106 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
cs46xx ALSA: cs46xx: Simplify with snd_ctl_find_id_mixer() 2023-07-21 09:10:39 +02:00
cs5535audio ALSA: cs5535audio: Remove the redundant assignment 2022-11-07 09:16:31 +01:00
ctxfi ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
echoaudio ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
emu10k1 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
hda ALSA: hda: cs35l56: Fix lifetime of cs_dsp instance 2024-05-08 18:18:29 +02:00
ice1712 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
korg1212 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
lola ALSA: lola: Bounds check loop iterator against streams array size 2022-05-21 08:48:57 +02:00
lx6464es ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
mixart ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
nm256 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
oxygen ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
pcxhr ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
riptide ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
rme9652 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
trident ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
vx222 ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
ymfpci ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
ad1889.c ALSA: ad1889: Fix the missing snd_card_free() call at probe error 2022-04-12 17:58:18 +02:00
ad1889.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ak4531_codec.c ALSA: ak4531: Fix assignment in if condition 2021-06-09 17:29:49 +02:00
als300.c ALSA: als300: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
als4000.c ALSA: als4000: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
atiixp.c ALSA: atiixp: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
atiixp_modem.c ALSA: atiixp: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
azt3328.c ALSA: azt3328: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:25 +01:00
azt3328.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bt87x.c ALSA: bt87x: Fix the missing snd_card_free() call at probe error 2022-04-12 17:58:36 +02:00
cmipci.c ALSA: cmipci: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:25 +01:00
cs4281.c ALSA: cs4281: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:25 +01:00
cs5530.c ALSA: cs5530: Allocate resources with device-managed APIs 2021-07-19 16:16:43 +02:00
ens1370.c ALSA: ens137x: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
ens1371.c
es1938.c ALSA: es1938: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
es1968.c ALSA: es1968: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
fm801.c ALSA: fm801: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
intel8x0.c ALSA: intel8x0: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
intel8x0m.c ALSA: intel8x0: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
Kconfig ALSA: add HAS_IOPORT dependencies 2023-05-22 16:43:47 +02:00
maestro3.c ALSA: maestro3: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
Makefile ALSA: pci: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:37 +02:00
rme32.c ALSA: rme32: Convert to generic PCM copy ops 2023-08-18 12:18:21 +02:00
rme96.c ALSA: rme96: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
sis7019.c ALSA: sis7019: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
sis7019.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 274 2019-06-05 17:30:30 +02:00
sonicvibes.c ALSA: sonicvibes: Fix the missing snd_card_free() call at probe error 2022-04-12 17:58:33 +02:00
via82xx.c ALSA: via82xx: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
via82xx_modem.c ALSA: via82xx: Simplify with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00