ALSA: mtpav: Don't call card private_free at probe error path
authorTakashi Iwai <tiwai@suse.de>
Tue, 12 Apr 2022 10:26:35 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:12 +0000 (09:34 +0200)
commitcb981d5c751197b95075e707179aee9cf63a1cac
treed35dd9e0b83614d7cf7893e23a04581619541c79
parent872e5fa0781f926a78c729d682cd0c3a51acf175
ALSA: mtpav: Don't call card private_free at probe error path

[ Upstream commit 4fb27190879b82e48ce89a56e9d6c04437dbc065 ]

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: aa92050f10f0 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/drivers/mtpav.c