Skip to content

Commit 4fb2719

Browse files
committed
ALSA: mtpav: Don't call card private_free at probe error path
The card destructor of nm256 driver does merely stopping the running timer, and it's superfluous for the probe error handling. Moreover, calling this via the previous devres change would lead to another problem due to the reverse call order. This patch moves the setup of the private_free callback after the card registration, so that it can be used only after fully set up. Fixes: aa92050 ("ALSA: mtpav: Allocate resources with device-managed APIs") Link: https://lore.kernel.org/r/20220412102636.16000-39-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent b2aa4f8 commit 4fb2719

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/drivers/mtpav.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,6 @@ static int snd_mtpav_probe(struct platform_device *dev)
693693
mtp_card->outmidihwport = 0xffffffff;
694694
timer_setup(&mtp_card->timer, snd_mtpav_output_timer, 0);
695695

696-
card->private_free = snd_mtpav_free;
697-
698696
err = snd_mtpav_get_RAWMIDI(mtp_card);
699697
if (err < 0)
700698
return err;
@@ -716,6 +714,8 @@ static int snd_mtpav_probe(struct platform_device *dev)
716714
if (err < 0)
717715
return err;
718716

717+
card->private_free = snd_mtpav_free;
718+
719719
platform_set_drvdata(dev, card);
720720
printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", irq, port);
721721
return 0;

0 commit comments

Comments
 (0)